working flake-parts

This commit is contained in:
Charlie Root 2024-07-21 21:58:18 +02:00
commit 35e6b01a56
15 changed files with 243 additions and 88 deletions

190
flake.lock generated
View file

@ -222,7 +222,28 @@
}, },
"devshell": { "devshell": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_6", "flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1717408969,
"narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=",
"owner": "numtide",
"repo": "devshell",
"rev": "1ebbe68d57457c8cae98145410b164b5477761f4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"devshell_2": {
"inputs": {
"flake-utils": "flake-utils_7",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
"nixpkgs" "nixpkgs"
@ -276,7 +297,7 @@
}, },
"emacs-overlay": { "emacs-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_3",
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
@ -610,11 +631,11 @@
"systems": "systems_4" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1701680307,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -625,7 +646,7 @@
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_6" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -660,23 +681,8 @@
} }
}, },
"flake-utils_4": { "flake-utils_4": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"inputs": { "inputs": {
"systems": "systems_9" "systems": "systems_8"
}, },
"locked": { "locked": {
"lastModified": 1710146030, "lastModified": 1710146030,
@ -692,10 +698,43 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_5": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": { "flake-utils_6": {
"inputs": { "inputs": {
"systems": "systems_10" "systems": "systems_10"
}, },
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_7": {
"inputs": {
"systems": "systems_11"
},
"locked": { "locked": {
"lastModified": 1701680307, "lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
@ -710,9 +749,9 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_7": { "flake-utils_8": {
"inputs": { "inputs": {
"systems": "systems_12" "systems": "systems_13"
}, },
"locked": { "locked": {
"lastModified": 1685518550, "lastModified": 1685518550,
@ -1064,7 +1103,7 @@
"hyprutils": "hyprutils", "hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner", "hyprwayland-scanner": "hyprwayland-scanner",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"systems": "systems_5", "systems": "systems_6",
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
@ -1221,7 +1260,7 @@
}, },
"lib-aggregate": { "lib-aggregate": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_5", "flake-utils": "flake-utils_6",
"nixpkgs-lib": "nixpkgs-lib_3" "nixpkgs-lib": "nixpkgs-lib_3"
}, },
"locked": { "locked": {
@ -1254,7 +1293,7 @@
}, },
"lix-module": { "lix-module": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"flakey-profile": "flakey-profile", "flakey-profile": "flakey-profile",
"lix": "lix", "lix": "lix",
"nixpkgs": [ "nixpkgs": [
@ -1313,7 +1352,7 @@
"neovim-flake": { "neovim-flake": {
"inputs": { "inputs": {
"flake-parts": "flake-parts_3", "flake-parts": "flake-parts_3",
"flake-utils": "flake-utils_3", "flake-utils": "flake-utils_4",
"mnw": "mnw", "mnw": "mnw",
"nil": "nil", "nil": "nil",
"nixpkgs": [ "nixpkgs": [
@ -1420,7 +1459,7 @@
"plugin-vim-vsnip": "plugin-vim-vsnip", "plugin-vim-vsnip": "plugin-vim-vsnip",
"plugin-which-key": "plugin-which-key", "plugin-which-key": "plugin-which-key",
"rnix-lsp": "rnix-lsp", "rnix-lsp": "rnix-lsp",
"systems": "systems_8", "systems": "systems_9",
"zig": "zig" "zig": "zig"
}, },
"locked": { "locked": {
@ -1777,6 +1816,22 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_13": {
"locked": {
"lastModified": 1719690277,
"narHash": "sha256-0xSej1g7eP2kaUF+JQp8jdyNmpmCJKRpO12mKl/36Kc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2741b4b489b55df32afac57bc4bfd220e8bf617e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1718714799, "lastModified": 1718714799,
@ -1907,7 +1962,7 @@
}, },
"nixvim": { "nixvim": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell_2",
"flake-compat": "flake-compat_5", "flake-compat": "flake-compat_5",
"flake-parts": "flake-parts_8", "flake-parts": "flake-parts_8",
"git-hooks": "git-hooks_2", "git-hooks": "git-hooks_2",
@ -3578,6 +3633,7 @@
"agenix": "agenix", "agenix": "agenix",
"ags": "ags", "ags": "ags",
"anyrun": "anyrun", "anyrun": "anyrun",
"devshell": "devshell",
"doom-emacs-config": "doom-emacs-config", "doom-emacs-config": "doom-emacs-config",
"doomemacs": "doomemacs", "doomemacs": "doomemacs",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
@ -3597,7 +3653,8 @@
"schizofox": "schizofox", "schizofox": "schizofox",
"spicetify-nix": "spicetify-nix", "spicetify-nix": "spicetify-nix",
"split-monitor-workspaces": "split-monitor-workspaces", "split-monitor-workspaces": "split-monitor-workspaces",
"stylix": "stylix" "stylix": "stylix",
"treefmt-nix": "treefmt-nix_3"
} }
}, },
"rust-overlay": { "rust-overlay": {
@ -3639,7 +3696,7 @@
"nixpkgs" "nixpkgs"
], ],
"searx-randomizer": "searx-randomizer", "searx-randomizer": "searx-randomizer",
"systems": "systems_11" "systems": "systems_12"
}, },
"locked": { "locked": {
"lastModified": 1719058240, "lastModified": 1719058240,
@ -3680,7 +3737,7 @@
}, },
"spicetify-nix": { "spicetify-nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_7", "flake-utils": "flake-utils_8",
"nixpkgs": "nixpkgs_11" "nixpkgs": "nixpkgs_11"
}, },
"locked": { "locked": {
@ -3777,6 +3834,21 @@
} }
}, },
"systems_11": { "systems_11": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_12": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@ -3791,7 +3863,7 @@
"type": "github" "type": "github"
} }
}, },
"systems_12": { "systems_13": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -3852,21 +3924,6 @@
} }
}, },
"systems_5": { "systems_5": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_6": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
@ -3881,6 +3938,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_6": {
"locked": {
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-linux",
"type": "github"
}
},
"systems_7": { "systems_7": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@ -3969,6 +4041,24 @@
"type": "github" "type": "github"
} }
}, },
"treefmt-nix_3": {
"inputs": {
"nixpkgs": "nixpkgs_13"
},
"locked": {
"lastModified": 1721458737,
"narHash": "sha256-wNXLQ/ATs1S4Opg1PmuNoJ+Wamqj93rgZYV3Di7kxkg=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "888bfb10a9b091d9ed2f5f8064de8d488f7b7c97",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1656928814, "lastModified": 1656928814,
@ -4017,7 +4107,7 @@
"zig": { "zig": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {

View file

@ -6,6 +6,11 @@
systems = [ systems = [
"x86-64_linux" "x86-64_linux"
]; ];
imports = [
inputs.treefmt-nix.flakeModule
./flake/shell.nix
./flake/fmt.nix
];
flake = { flake = {
nixosConfigurations = import ./hosts {inherit inputs withSystem;}; nixosConfigurations = import ./hosts {inherit inputs withSystem;};
}; };
@ -53,6 +58,13 @@
inputs.hyprland.follows = "hyprland"; inputs.hyprland.follows = "hyprland";
}; };
treefmt-nix.url = "github:numtide/treefmt-nix";
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
neovim-flake = { neovim-flake = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

33
flake/fmt.nix Normal file
View file

@ -0,0 +1,33 @@
{
perSystem = {
config,
pkgs,
...
}: {
# https://github.com/numtide/treefmt-nix?tab=readme-ov-file#flake-parts
formatter = config.treefmt.build.wrapper;
treefmt = {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
shellcheck.enable = true; # cannot be configured, errors on basic bash convention
prettier = {
enable = true;
package = pkgs.prettierd;
excludes = ["*.age"];
settings = {
editorconfig = true;
};
};
shfmt = {
enable = true;
# https://flake.parts/options/treefmt-nix.html#opt-perSystem.treefmt.programs.shfmt.indent_size
indent_size = 2; # set to 0 to use tabs
};
};
};
};
}

28
flake/shell.nix Normal file
View file

@ -0,0 +1,28 @@
{
perSystem = {pkgs, ...}: {
devShells.default = pkgs.mkShellNoCC {
name = "nichts";
DIRENV_LOG_FORMAT = "";
packages = with pkgs; [
nil # nix language server
alejandra
git # take a guess
statix # no idea
deadnix # clean up unused nix code
(pkgs.writeShellApplication {
name = "update";
text = ''
nix flake update && git commit flake.lock -m "flake: bump inputs"
'';
})
(pkgs.writeShellApplication {
name = "rebuild";
text = ''
nh os switch
'';
})
];
};
};
}

View file

@ -25,7 +25,6 @@
inherit lib; inherit lib;
inherit inputs inputs'; inherit inputs inputs';
inherit self self'; inherit self self';
inherit system;
} }
(args.specialArgs or {}); (args.specialArgs or {});
inherit (args) modules; inherit (args) modules;
@ -39,31 +38,17 @@ in {
./vali/temperance ./vali/temperance
../modules ../modules
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.agenix.nixosModules.default
inputs.lix-module.nixosModules.default inputs.lix-module.nixosModules.default
]; ];
}; };
# temperance = hermit = mkSystem {
# lib.nixosSystem rec { inherit withSystem;
# system = "x86_64-linux";
# specialArgs = {
# inherit lib;
# inherit
# inputs
# self
# system
# ;
# };
# });
hermit = lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = {inherit lib inputs self system;};
modules = [ modules = [
./vali/hermit ./vali/hermit
../modules ../modules
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
inputs.agenix.nixosModules.default
inputs.lix-module.nixosModules.default inputs.lix-module.nixosModules.default
inputs.nixos-hardware.nixosModules.dell-xps-15-7590-nvidia inputs.nixos-hardware.nixosModules.dell-xps-15-7590-nvidia
]; ];

View file

@ -1,9 +1,9 @@
{ {
inputs, inputs',
pkgs, pkgs,
... ...
}: let }: let
nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; nixpkgs-wayland = inputs'.nixpkgs-wayland.packages;
in { in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
alejandra alejandra

View file

@ -1,9 +1,9 @@
{ {
inputs, inputs',
pkgs, pkgs,
... ...
}: let }: let
nixpkgs-wayland = inputs.nixpkgs-wayland.packages.${pkgs.system}; nixpkgs-wayland = inputs'.nixpkgs-wayland.packages;
in { in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
abaddon abaddon

View file

@ -1,6 +1,6 @@
{ {
config, config,
inputs, inputs',
lib, lib,
pkgs, pkgs,
... ...
@ -15,7 +15,7 @@ in {
home-manager.users.${username} = { home-manager.users.${username} = {
programs.foot = { programs.foot = {
enable = true; enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.foot; package = inputs'.nixpkgs-wayland.packages.foot;
settings = { settings = {
main = { main = {
term = "foot"; term = "foot";

View file

@ -3,12 +3,12 @@
pkgs, pkgs,
lib, lib,
inputs, inputs,
inputs',
... ...
}: let }: let
cfg = config.modules.system.programs.spotify; cfg = config.modules.system.programs.spotify;
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; spicePkgs = inputs'.spicetify-nix.packages.default;
# inherit (inputs.spicetify-nix.packages.${pkgs.system}) spicetify-nix;
in { in {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home-manager.users.${username} = { home-manager.users.${username} = {

View file

@ -1,6 +1,6 @@
{ {
config, config,
inputs, inputs',
lib, lib,
pkgs, pkgs,
... ...
@ -16,7 +16,7 @@ in {
home-manager.users.${username} = { home-manager.users.${username} = {
services.dunst = { services.dunst = {
enable = true; enable = true;
package = inputs.nixpkgs-wayland.packages.${pkgs.system}.dunst; package = inputs'.nixpkgs-wayland.packages.dunst;
settings = { settings = {
global = { global = {
monitor = 1; monitor = 1;

View file

@ -1,6 +1,6 @@
{ {
config, config,
inputs, inputs',
lib, lib,
pkgs, pkgs,
... ...
@ -25,10 +25,10 @@ with lib; let
#exec-once=[workspace 1;fullscreen;noanim] ${ #exec-once=[workspace 1;fullscreen;noanim] ${
pkgs.greetd.${cfg.greeter} pkgs.greetd.${cfg.greeter}
}/bin/${cfg.greeter} -l; ${ }/bin/${cfg.greeter} -l; ${
inputs.hyprland.packages.${pkgs.system}.hyprland inputs'.hyprland.packages.hyprland
}/bin/hyprctl dispatch exit }/bin/hyprctl dispatch exit
#exec-once=${ #exec-once=${
inputs.hyprland.packages.${pkgs.system}.hyprland inputs'.hyprland.packages.hyprland
}/bin/hyprctl dispatch focuswindow ${cfg.greeter} }/bin/hyprctl dispatch focuswindow ${cfg.greeter}
''; '';
in { in {
@ -49,7 +49,7 @@ in {
enable = true; enable = true;
settings.default_session = { settings.default_session = {
command = "${ command = "${
inputs.hyprland.packages.${pkgs.system}.hyprland inputs'.hyprland.packages.hyprland
}/bin/Hyprland --config ${hyprlandConfig}"; }/bin/Hyprland --config ${hyprlandConfig}";
user = username; user = username;
}; };

View file

@ -9,6 +9,14 @@ with lib; let
inherit (config.modules.other.system) username; inherit (config.modules.other.system) username;
in { in {
options.modules.programs.ssh.enable = mkEnableOption "ssh"; options.modules.programs.ssh.enable = mkEnableOption "ssh";
config = {
config = mkIf cfg.enable {programs.ssh = {startAgent = true;};}; programs.ssh.startAgent = true;
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
};
} }

View file

@ -1,7 +1,7 @@
{ {
config, config,
lib, lib,
system, #system,
inputs, inputs,
pkgs, pkgs,
... ...
@ -17,7 +17,7 @@ in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
qt6.qtimageformats qt6.qtimageformats
qt6.qt5compat qt6.qt5compat
quickshell.packages.${system}.default #quickshell.packages.${system}.default
pamtester pamtester
]; ];
home-manager.users.${username}.xdg.configFile."quickshell/manifest.conf".text = toKeyValue {} { home-manager.users.${username}.xdg.configFile."quickshell/manifest.conf".text = toKeyValue {} {

View file

@ -1,12 +1,11 @@
{ {
pkgs, inputs',
inputs,
config, config,
... ...
}: { }: {
programs.niri = { programs.niri = {
enable = true; enable = true;
package = inputs.niri.packages.${pkgs.system}.niri-unstable; package = inputs'.niri.packages.niri-unstable;
}; };
services = { services = {
greetd = { greetd = {