♻️ refactor flake-utils usage

This commit is contained in:
James Walker 2025-06-01 14:21:00 -04:00
parent 38aff239a0
commit 7b8c02a19e
Signed by: walkah
SSH Key Fingerprint: SHA256:f7Gn4jO4BFHZxWfKTTzEAfWz+cLW51IyGFl9MjDyZGI
3 changed files with 28 additions and 48 deletions

40
flake.lock generated
View File

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748149228, "lastModified": 1748352827,
"narHash": "sha256-mmonYFesFo42UUS49Hd0bcbVJRWX/aHBCDYUkkvylf4=", "narHash": "sha256-sNUUP6qxGkK9hXgJ+p362dtWLgnIWwOCmiq72LAWtYo=",
"owner": "nix-darwin", "owner": "nix-darwin",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "a9939228f661df370c4094fe85f683e45d761dbe", "rev": "44a7d0e687a87b73facfe94fba78d323a6686a90",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -53,24 +53,6 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": { "gitignore": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -99,11 +81,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1748227609, "lastModified": 1748737919,
"narHash": "sha256-SaSdslyo6UGDpPUlmrPA4dWOEuxCy2ihRN9K6BnqYsA=", "narHash": "sha256-5kvBbLYdp+n7Ftanjcs6Nv+UO6sBhelp6MIGJ9nWmjQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d23d20f55d49d8818ac1f1b2783671e8a6725022", "rev": "5675a9686851d9626560052a032c4e14e533c1fa",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -184,11 +166,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1748217807, "lastModified": 1748662220,
"narHash": "sha256-P3u2PXxMlo49PutQLnk2PhI/imC69hFl1yY4aT5Nax8=", "narHash": "sha256-7gGa49iB9nCnFk4h/g9zwjlQAyjtpgcFkODjcOQS0Es=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3108eaa516ae22c2360928589731a4f1581526ef", "rev": "59138c7667b7970d205d6a05a8bfa2d78caa3643",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -267,13 +249,13 @@
"inputs": { "inputs": {
"darwin": "darwin", "darwin": "darwin",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"raspberry-pi-nix": "raspberry-pi-nix", "raspberry-pi-nix": "raspberry-pi-nix",
"sops-nix": "sops-nix" "sops-nix": "sops-nix",
"systems": "systems"
} }
}, },
"rpi-bluez-firmware-src": { "rpi-bluez-firmware-src": {

View File

@ -3,8 +3,8 @@
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix"; raspberry-pi-nix.url = "github:nix-community/raspberry-pi-nix";
flake-utils.url = "github:numtide/flake-utils";
darwin = { darwin = {
url = "github:nix-darwin/nix-darwin/master"; url = "github:nix-darwin/nix-darwin/master";
@ -41,31 +41,29 @@
{ {
self, self,
nixpkgs, nixpkgs,
flake-utils,
pre-commit-hooks, pre-commit-hooks,
systems,
... ...
}@inputs: }@inputs:
flake-utils.lib.eachDefaultSystem (
system:
let let
pkgs = import nixpkgs { forAllSystems =
inherit system; fn: nixpkgs.lib.genAttrs (import systems) (system: fn system nixpkgs.legacyPackages.${system});
overlays = [ self.overlays.default ];
};
in in
{ {
checks = import ./nix/checks.nix { checks = forAllSystems (
system: pkgs:
import ./nix/checks.nix {
inherit inherit
self self
pkgs pkgs
system
pre-commit-hooks pre-commit-hooks
system
; ;
};
devShells = import ./nix/shells.nix { inherit self pkgs system; };
formatter = pkgs.nixfmt-tree;
} }
) );
devShells = forAllSystems (system: pkgs: import ./nix/shells.nix { inherit self pkgs system; });
formatter = forAllSystems (_: pkgs: pkgs.nixfmt-tree);
}
// { // {
hosts = import ./nix/hosts.nix; hosts = import ./nix/hosts.nix;
overlays.default = nixpkgs.lib.composeManyExtensions [ ]; overlays.default = nixpkgs.lib.composeManyExtensions [ ];

View File

@ -13,7 +13,6 @@ let
hostSystem = self.hosts.${hostName}.system; hostSystem = self.hosts.${hostName}.system;
in in
nixpkgs.lib.nixosSystem { nixpkgs.lib.nixosSystem {
system = hostSystem;
modules = [ modules = [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
(_: { (_: {
@ -21,6 +20,7 @@ let
nixpkgs.overlays = [ self.overlays.default ]; nixpkgs.overlays = [ self.overlays.default ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
}) })
{ nixpkgs.hostPlatform = hostSystem; }
] ++ modules; ] ++ modules;
specialArgs = { inherit raspberry-pi-nix sops-nix; }; specialArgs = { inherit raspberry-pi-nix sops-nix; };
}; };