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

View File

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

View File

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