move systems into a separate directory

This commit is contained in:
uku 2023-11-14 18:29:14 +01:00
parent 89f997e158
commit 18121a0f9f
Signed by: uku
GPG key ID: 7D01D7B105E77166
9 changed files with 111 additions and 88 deletions

View file

@ -31,43 +31,13 @@
}; };
}; };
outputs = { outputs = {flake-parts, ...} @ inputs:
flake-parts,
nixpkgs,
lanzaboote,
home-manager,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"]; systems = ["x86_64-linux"];
imports = [./dev.nix]; imports = [
./dev.nix
flake = let ./systems
mkSystem = modules: name: ];
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules =
[
./${name}
./${name}/hardware-configuration.nix
{networking.hostName = name;}
]
++ modules;
specialArgs = inputs;
};
mkDesktop = mkSystem [
./common.nix
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager
];
in {
nixosConfigurations = {
fuji = mkDesktop "fuji";
kilimandjaro = mkDesktop "kilimandjaro";
};
};
}; };
} }

59
systems/common.nix Normal file
View file

@ -0,0 +1,59 @@
{
pkgs,
nixpkgs,
...
}: {
environment.systemPackages = with pkgs; [
neovim
git
curl
nix-your-shell
];
programs = {
fish = {
enable = true;
interactiveShellInit = ''
nix-your-shell fish | source
'';
};
direnv.enable = true;
command-not-found.enable = false;
nix-index = {
enable = true;
enableFishIntegration = true;
};
};
nixpkgs.config.allowUnfree = true;
nix = {
gc = {
automatic = true;
dates = "3d";
options = "-d";
};
settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
};
};
nix.registry = let
nixpkgsRegistry.flake = nixpkgs;
in {
nixpkgs = nixpkgsRegistry;
n = nixpkgsRegistry;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

44
systems/default.nix Normal file
View file

@ -0,0 +1,44 @@
{
lib,
inputs,
...
}: let
# shamelessly borrowed from https://github.com/getchoo/flake/blob/94dc521310b34b80158d1a0ab65d4daa3a44d81e/systems/default.nix
toSystem = builder: name: args:
(args.builder or builder) (
(builtins.removeAttrs args ["builder"])
// {
modules =
args.modules
++ [
./common.nix
./${name}
./${name}/hardware-configuration.nix
{networking.hostName = name;}
];
specialArgs = inputs;
}
);
mapNixOS = lib.mapAttrs (toSystem inputs.nixpkgs.lib.nixosSystem);
desktop = with inputs; [
./desktop.nix
lanzaboote.nixosModules.lanzaboote
home-manager.nixosModules.home-manager
];
in {
flake.nixosConfigurations = mapNixOS {
fuji = {
system = "x86_64-linux";
modules = desktop;
};
kilimandjaro = {
system = "x86_64-linux";
modules = desktop;
};
};
}

View file

@ -1,14 +1,13 @@
{ {
lib, lib,
pkgs, pkgs,
nixpkgs,
getchvim, getchvim,
... ...
}: let }: let
username = "leo"; username = "leo";
in { in {
imports = [ imports = [
./programs ../programs
(lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username]) (lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username])
]; ];
@ -132,7 +131,6 @@ in {
osu-lazer-bin osu-lazer-bin
gnome.file-roller gnome.file-roller
getchvim.packages.${system}.default getchvim.packages.${system}.default
nix-your-shell
]; ];
services = { services = {
@ -145,27 +143,12 @@ in {
}; };
programs = { programs = {
fish = {
enable = true;
interactiveShellInit = ''
nix-your-shell fish | source
'';
};
gnupg.agent = { gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
pinentryFlavor = "gnome3"; pinentryFlavor = "gnome3";
}; };
direnv.enable = true;
command-not-found.enable = false;
nix-index = {
enable = true;
enableFishIntegration = true;
};
seahorse.enable = true; seahorse.enable = true;
steam.enable = true; steam.enable = true;
@ -191,40 +174,7 @@ in {
(nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono"];}) (nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono"];})
]; ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [sbctl];
neovim
git
sbctl
];
nixpkgs.config.allowUnfree = true; hm.home.stateVersion = "23.11";
nix = {
gc = {
automatic = true;
dates = "3d";
options = "-d";
};
settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
};
};
nix.registry = let
nixpkgsRegistry.flake = nixpkgs;
in {
nixpkgs = nixpkgsRegistry;
n = nixpkgsRegistry;
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
hm.home.stateVersion = "23.05";
} }