♻️ backwards compatibility for non-flake systems

This commit is contained in:
James Walker 2022-05-08 14:06:24 -04:00
parent ea5ba53e3c
commit ef245c59a7
Signed by: walkah
GPG Key ID: 3C127179D6086E93
4 changed files with 58 additions and 29 deletions

13
default.nix Normal file
View File

@ -0,0 +1,13 @@
(import
(
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{
src = ./.;
}).defaultNix

35
flake.lock generated
View File

@ -28,11 +28,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1651201720, "lastModified": 1651881376,
"narHash": "sha256-nx4UKikzjZLunB1VUf5I8jFurn0rfc3y1xceb6deDmI=", "narHash": "sha256-JEG/G/ILu01/rrrDlCG27dToDUKB/C7nw2N0Pfk11w4=",
"owner": "walkah", "owner": "walkah",
"repo": "dotfiles", "repo": "dotfiles",
"rev": "a9529560bffd9d1093e957b9b5d7bdcedaa39f8e", "rev": "8009def87838bc2b7b4fd9d48e89f83bb2cbe134",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -57,6 +57,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1649676176, "lastModified": 1649676176,
@ -98,11 +114,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1651800560, "lastModified": 1651886851,
"narHash": "sha256-LUfR0/Fv8DA0uu8Uex2S1QcLiE4B5ylplbXmMs6/YoM=", "narHash": "sha256-kbXOJSf1uho0/7P54nZkJdJY3oAelIjyc6tfiRhaXJI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "538343be863cb0b9e9f1471e6dc09e0e140c7b3d", "rev": "882bd8118bdbff3a6e53e5ced393932b351ce2f6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -129,11 +145,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1651804312, "lastModified": 1651981559,
"narHash": "sha256-DJxOGlxwQccuuwXUS0oRRkcNJbW5UP4fpsL5ga9ZwYw=", "narHash": "sha256-vOcCFzuBbYsDyAahnd8PcxcRAAMeDL/fefvIRPyuOi0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d59dd43e49f24b58fe8d5ded38cbdf00c3da4dc2", "rev": "0f949eb7f11e0f7fbe5bb863a900104227969bf7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -161,6 +177,7 @@
"inputs": { "inputs": {
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"dotfiles": "dotfiles", "dotfiles": "dotfiles",
"flake-compat": "flake-compat_2",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"

View File

@ -7,6 +7,11 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
# My stuff # My stuff
dotfiles = { dotfiles = {
url = "github:walkah/dotfiles"; url = "github:walkah/dotfiles";
@ -22,7 +27,7 @@
, home-manager , home-manager
, dotfiles , dotfiles
, ... , ...
}@attrs: }:
let let
mkSystem = hostName: system: modules: mkSystem = hostName: system: modules:

View File

@ -1,19 +1,13 @@
let (import
sources = import ./nix/sources.nix; (
pkgs = import sources.nixpkgs { let
overlays = [ (import ./overlays) ]; lock = builtins.fromJSON (builtins.readFile ./flake.lock);
config = { }; in
}; fetchTarball {
in url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
pkgs.mkShell { sha256 = lock.nodes.flake-compat.locked.narHash;
name = "athens"; }
buildInputs = [ )
pkgs.age {
pkgs.morph src = ./.;
pkgs.sops }).shellNix
];
shellHook = ''
export NIX_PATH="nixpkgs=${sources.nixpkgs}:home-manager=${sources.home-manager}:."
'';
}