init flake-utils

This commit is contained in:
cy 2025-01-13 01:34:20 -05:00
parent b6c18ce5f2
commit 4cded3c746
3 changed files with 48 additions and 14 deletions

42
flake.lock generated
View file

@ -139,6 +139,24 @@
"inputs": { "inputs": {
"systems": "systems" "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"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
@ -153,9 +171,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@ -315,7 +333,7 @@
"crane": "crane", "crane": "crane",
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
@ -452,7 +470,7 @@
}, },
"nuschtosSearch": { "nuschtosSearch": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"ixx": "ixx", "ixx": "ixx",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
@ -503,6 +521,7 @@
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"lanzaboote": "lanzaboote", "lanzaboote": "lanzaboote",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
@ -588,6 +607,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt": { "treefmt": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [

View file

@ -27,6 +27,7 @@
url = "github:nix-community/nixvim"; url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = "github:numtide/flake-utils";
nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk"; # unmerged PR nixpkgs-btrbk.url = "github:cything/nixpkgs/btrbk"; # unmerged PR
nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR
@ -53,20 +54,19 @@
home-manager, home-manager,
treefmt, treefmt,
disko, disko,
flake-utils,
... ...
}@inputs: }@inputs:
let let
lib = nixpkgs.lib; lib = nixpkgs.lib;
inherit (self) outputs; inherit (self) outputs;
systems = [ "x86_64-linux" ];
forEachSystem = f: lib.genAttrs systems (system: f pkgsFor.${system});
overlays = [ overlays = [
# (overlayPkgsFromFlake inputs.eza [ # (overlayPkgsFromFlake inputs.eza [
# ]) # ])
] ++ import ./overlay; ] ++ import ./overlay;
pkgsFor = lib.genAttrs systems ( pkgsFor = flake-utils.lib.eachDefaultSystem (
system: system:
import nixpkgs { import nixpkgs {
inherit system overlays; inherit system overlays;
@ -76,9 +76,9 @@
} }
); );
treefmtEval = forEachSystem ( treefmtEval = flake-utils.lib.eachDefaultSystem (
pkgs: system:
treefmt.lib.evalModule pkgs { treefmt.lib.evalModule pkgsFor.system {
projectRootFile = "flake.nix"; projectRootFile = "flake.nix";
programs.nixfmt.enable = true; programs.nixfmt.enable = true;
programs.stylua.enable = true; programs.stylua.enable = true;
@ -92,9 +92,9 @@
); );
in in
{ {
formatter = forEachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper); formatter = flake-utils.lib.eachDefaultSystem (system: treefmtEval.${system}.config.build.wrapper);
checks = forEachSystem (pkgs: { checks = flake-utils.lib.eachDefaultSystem (system: {
formatting = treefmtEval.${pkgs.system}.config.build.check self; formatting = treefmtEval.${system}.config.build.check self;
}); });
# lets us build overlaid packages with `nix build .#<package>` # lets us build overlaid packages with `nix build .#<package>`
packages = pkgsFor; packages = pkgsFor;

View file

@ -147,7 +147,7 @@
servers = { servers = {
bashls.enable = true; bashls.enable = true;
lua_ls.enable = true; lua_ls.enable = true;
nil_ls.enable = true; nixd.enable = true;
rust_analyzer = { rust_analyzer = {
enable = true; enable = true;
installRustc = true; installRustc = true;