move systems into a separate directory
This commit is contained in:
parent
89f997e158
commit
18121a0f9f
9 changed files with 111 additions and 88 deletions
40
flake.nix
40
flake.nix
|
@ -31,43 +31,13 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
flake-parts,
|
||||
nixpkgs,
|
||||
lanzaboote,
|
||||
home-manager,
|
||||
...
|
||||
} @ inputs:
|
||||
outputs = {flake-parts, ...} @ inputs:
|
||||
flake-parts.lib.mkFlake {inherit inputs;} {
|
||||
systems = ["x86_64-linux"];
|
||||
|
||||
imports = [./dev.nix];
|
||||
|
||||
flake = let
|
||||
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";
|
||||
};
|
||||
};
|
||||
imports = [
|
||||
./dev.nix
|
||||
./systems
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
59
systems/common.nix
Normal file
59
systems/common.nix
Normal 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. It‘s 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
44
systems/default.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,14 +1,13 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
nixpkgs,
|
||||
getchvim,
|
||||
...
|
||||
}: let
|
||||
username = "leo";
|
||||
in {
|
||||
imports = [
|
||||
./programs
|
||||
../programs
|
||||
(lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username])
|
||||
];
|
||||
|
||||
|
@ -132,7 +131,6 @@ in {
|
|||
osu-lazer-bin
|
||||
gnome.file-roller
|
||||
getchvim.packages.${system}.default
|
||||
nix-your-shell
|
||||
];
|
||||
|
||||
services = {
|
||||
|
@ -145,27 +143,12 @@ in {
|
|||
};
|
||||
|
||||
programs = {
|
||||
fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
nix-your-shell fish | source
|
||||
'';
|
||||
};
|
||||
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
pinentryFlavor = "gnome3";
|
||||
};
|
||||
|
||||
direnv.enable = true;
|
||||
|
||||
command-not-found.enable = false;
|
||||
nix-index = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
};
|
||||
|
||||
seahorse.enable = true;
|
||||
steam.enable = true;
|
||||
|
||||
|
@ -191,40 +174,7 @@ in {
|
|||
(nerdfonts.override {fonts = ["Iosevka" "JetBrainsMono"];})
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
neovim
|
||||
git
|
||||
sbctl
|
||||
];
|
||||
environment.systemPackages = with pkgs; [sbctl];
|
||||
|
||||
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. It‘s 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";
|
||||
hm.home.stateVersion = "23.11";
|
||||
}
|
Loading…
Reference in a new issue