summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock246
-rw-r--r--flake.nix70
2 files changed, 79 insertions, 237 deletions
diff --git a/flake.lock b/flake.lock
index 55c2e95..b5625a4 100644
--- a/flake.lock
+++ b/flake.lock
@@ -23,7 +23,7 @@
},
"crane": {
"inputs": {
- "flake-compat": "flake-compat",
+ "flake-compat": "flake-compat_2",
"flake-utils": [
"lanzaboote",
"flake-utils"
@@ -76,11 +76,11 @@
"flake-compat": {
"flake": false,
"locked": {
- "lastModified": 1668681692,
- "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
+ "lastModified": 1673956053,
+ "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"owner": "edolstra",
"repo": "flake-compat",
- "rev": "009399224d5e398d03b22badca40a37ac85412a1",
+ "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"type": "github"
},
"original": {
@@ -105,54 +105,6 @@
"type": "github"
}
},
- "flake-compat_3": {
- "flake": false,
- "locked": {
- "lastModified": 1668681692,
- "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
- "owner": "edolstra",
- "repo": "flake-compat",
- "rev": "009399224d5e398d03b22badca40a37ac85412a1",
- "type": "github"
- },
- "original": {
- "owner": "edolstra",
- "repo": "flake-compat",
- "type": "github"
- }
- },
- "flake-compat_4": {
- "flake": false,
- "locked": {
- "lastModified": 1673956053,
- "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
- "owner": "edolstra",
- "repo": "flake-compat",
- "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
- "type": "github"
- },
- "original": {
- "owner": "edolstra",
- "repo": "flake-compat",
- "type": "github"
- }
- },
- "flake-compat_5": {
- "flake": false,
- "locked": {
- "lastModified": 1673956053,
- "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
- "owner": "edolstra",
- "repo": "flake-compat",
- "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
- "type": "github"
- },
- "original": {
- "owner": "edolstra",
- "repo": "flake-compat",
- "type": "github"
- }
- },
"flake-parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
@@ -173,41 +125,11 @@
},
"flake-utils": {
"locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
- },
- "flake-utils_2": {
- "locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
- },
- "flake-utils_3": {
- "locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
+ "lastModified": 1676283394,
+ "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
"owner": "numtide",
"repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
+ "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
"type": "github"
},
"original": {
@@ -222,7 +144,9 @@
"nixpkgs": [
"nixpkgs"
],
- "utils": "utils"
+ "utils": [
+ "flake-utils"
+ ]
},
"locked": {
"lastModified": 1678068193,
@@ -241,28 +165,6 @@
"gitignore": {
"inputs": {
"nixpkgs": [
- "lanzaboote",
- "pre-commit-hooks-nix",
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1660459072,
- "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
- "owner": "hercules-ci",
- "repo": "gitignore.nix",
- "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
- "type": "github"
- },
- "original": {
- "owner": "hercules-ci",
- "repo": "gitignore.nix",
- "type": "github"
- }
- },
- "gitignore_2": {
- "inputs": {
- "nixpkgs": [
"pre-commit-hooks",
"nixpkgs"
]
@@ -286,7 +188,9 @@
"nixpkgs": [
"nixpkgs"
],
- "utils": "utils_2"
+ "utils": [
+ "flake-utils"
+ ]
},
"locked": {
"lastModified": 1677704978,
@@ -305,14 +209,20 @@
"lanzaboote": {
"inputs": {
"crane": "crane",
- "flake-compat": "flake-compat_2",
+ "flake-compat": [
+ "flake-compat"
+ ],
"flake-parts": "flake-parts",
- "flake-utils": "flake-utils",
+ "flake-utils": [
+ "flake-utils"
+ ],
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-test": "nixpkgs-test",
- "pre-commit-hooks-nix": "pre-commit-hooks-nix",
+ "pre-commit-hooks-nix": [
+ "pre-commit-hooks"
+ ],
"rust-overlay": "rust-overlay"
},
"locked": {
@@ -367,8 +277,12 @@
},
"nixos-wsl": {
"inputs": {
- "flake-compat": "flake-compat_4",
- "flake-utils": "flake-utils_2",
+ "flake-compat": [
+ "flake-compat"
+ ],
+ "flake-utils": [
+ "flake-utils"
+ ],
"nixpkgs": [
"nixpkgs"
]
@@ -420,38 +334,6 @@
"type": "github"
}
},
- "nixpkgs-stable": {
- "locked": {
- "lastModified": 1671271954,
- "narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "ref": "nixos-22.05",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
- "nixpkgs-stable_2": {
- "locked": {
- "lastModified": 1673800717,
- "narHash": "sha256-SFHraUqLSu5cC6IxTprex/nTsI81ZQAtDvlBvGDWfnA=",
- "owner": "NixOS",
- "repo": "nixpkgs",
- "rev": "2f9fd351ec37f5d479556cd48be4ca340da59b8f",
- "type": "github"
- },
- "original": {
- "owner": "NixOS",
- "ref": "nixos-22.11",
- "repo": "nixpkgs",
- "type": "github"
- }
- },
"nixpkgs-test": {
"locked": {
"lastModified": 1671812130,
@@ -500,48 +382,26 @@
},
"pre-commit-hooks": {
"inputs": {
- "flake-compat": "flake-compat_5",
- "flake-utils": "flake-utils_3",
- "gitignore": "gitignore_2",
- "nixpkgs": [
- "nixpkgs"
+ "flake-compat": [
+ "flake-compat"
],
- "nixpkgs-stable": "nixpkgs-stable_2"
- },
- "locked": {
- "lastModified": 1678376203,
- "narHash": "sha256-3tyYGyC8h7fBwncLZy5nCUjTJPrHbmNwp47LlNLOHSM=",
- "owner": "cachix",
- "repo": "pre-commit-hooks.nix",
- "rev": "1a20b9708962096ec2481eeb2ddca29ed747770a",
- "type": "github"
- },
- "original": {
- "owner": "cachix",
- "repo": "pre-commit-hooks.nix",
- "type": "github"
- }
- },
- "pre-commit-hooks-nix": {
- "inputs": {
- "flake-compat": "flake-compat_3",
"flake-utils": [
- "lanzaboote",
"flake-utils"
],
"gitignore": "gitignore",
"nixpkgs": [
- "lanzaboote",
- "nixpkgs"
+ "nixpkgsUnstable"
],
- "nixpkgs-stable": "nixpkgs-stable"
+ "nixpkgs-stable": [
+ "nixpkgs"
+ ]
},
"locked": {
- "lastModified": 1672912243,
- "narHash": "sha256-QnQeKUjco2kO9J4rBqIBPp5XcOMblIMnmyhpjeaJBYc=",
+ "lastModified": 1678376203,
+ "narHash": "sha256-3tyYGyC8h7fBwncLZy5nCUjTJPrHbmNwp47LlNLOHSM=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
- "rev": "a4548c09eac4afb592ab2614f4a150120b29584c",
+ "rev": "1a20b9708962096ec2481eeb2ddca29ed747770a",
"type": "github"
},
"original": {
@@ -553,6 +413,8 @@
"root": {
"inputs": {
"agenix": "agenix",
+ "flake-compat": "flake-compat",
+ "flake-utils": "flake-utils",
"getchoo": "getchoo",
"home-manager": "home-manager",
"lanzaboote": "lanzaboote",
@@ -588,36 +450,6 @@
"repo": "rust-overlay",
"type": "github"
}
- },
- "utils": {
- "locked": {
- "lastModified": 1676283394,
- "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
- },
- "utils_2": {
- "locked": {
- "lastModified": 1667395993,
- "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
- "type": "github"
- },
- "original": {
- "owner": "numtide",
- "repo": "flake-utils",
- "type": "github"
- }
}
},
"root": "root",
diff --git a/flake.nix b/flake.nix
index 6a70cd8..c381557 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,50 +1,59 @@
{
+ description = "getchoo's flake for nixos and home configurations";
+
inputs = {
nixpkgsUnstable.url = "nixpkgs/nixos-unstable";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgsUnstable";
};
+ # this is just to avoid having multiple versions in flake.lock
+ flake-compat = {
+ url = "github:edolstra/flake-compat";
+ flake = false;
+ };
+ flake-utils.url = "github:numtide/flake-utils";
getchoo = {
url = "github:getchoo/overlay";
inputs.nixpkgs.follows = "nixpkgs";
+ inputs.utils.follows = "flake-utils";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
+ inputs.utils.follows = "flake-utils";
};
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
+ inputs.flake-compat.follows = "flake-compat";
+ inputs.flake-utils.follows = "flake-utils";
+ inputs.pre-commit-hooks-nix.follows = "pre-commit-hooks";
};
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
+ inputs.flake-compat.follows = "flake-compat";
+ inputs.flake-utils.follows = "flake-utils";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
nur.url = "github:nix-community/NUR";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
- inputs.nixpkgs.follows = "nixpkgs";
+ inputs.nixpkgs.follows = "nixpkgsUnstable";
+ inputs.nixpkgs-stable.follows = "nixpkgs";
+ inputs.flake-compat.follows = "flake-compat";
+ inputs.flake-utils.follows = "flake-utils";
};
};
outputs = inputs @ {
self,
nixpkgs,
- nixpkgsUnstable,
+ flake-utils,
pre-commit-hooks,
...
}: let
- supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
- forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
-
- mkPkgsFor = pkgs: forAllSystems (system: import pkgs {inherit system;});
- channels = {
- nixpkgs = mkPkgsFor nixpkgs;
- nixpkgsUnstable = mkPkgsFor nixpkgsUnstable;
- };
-
util = import ./util {
inherit (nixpkgs) lib;
inherit inputs;
@@ -54,22 +63,22 @@
users = import ./users {inherit inputs;};
hosts = import ./hosts {inherit inputs;};
- in {
- checks = forAllSystems (system: {
- pre-commit-check = pre-commit-hooks.lib.${system}.run {
- src = ./.;
- hooks = {
- alejandra.enable = true;
- deadnix.enable = true;
- statix.enable = true;
+ in
+ flake-utils.lib.eachDefaultSystem (system: let
+ pkgs = nixpkgs.legacyPackages.${system};
+ in {
+ checks = {
+ pre-commit-check = pre-commit-hooks.lib.${system}.run {
+ src = ./.;
+ hooks = {
+ alejandra.enable = true;
+ deadnix.enable = true;
+ statix.enable = true;
+ };
};
};
- });
- devShells = forAllSystems (system: let
- pkgs = nixpkgs.legacyPackages.${system};
- in
- with pkgs; {
+ devShells = with pkgs; {
default = mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
packages = [
@@ -78,12 +87,13 @@
statix
];
};
- });
-
- formatter = forAllSystems (system: channels.nixpkgs.${system}.alejandra);
+ };
- homeConfigurations = forAllSystems (system: mapHMUsers (users.users {inherit system;}));
+ formatter = pkgs.alejandra;
- nixosConfigurations = mapHosts hosts;
- };
+ homeConfigurations = mapHMUsers (users.users {inherit system;});
+ })
+ // {
+ nixosConfigurations = mapHosts hosts;
+ };
}