mirror of
https://codeberg.org/muon/home.git
synced 2025-12-06 08:07:45 +00:00
Add minimal modular setup
This commit is contained in:
commit
e81d8c9be4
19 changed files with 351 additions and 0 deletions
4
modules/nixos/core/boot.nix
Normal file
4
modules/nixos/core/boot.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
||||
7
modules/nixos/core/default.nix
Normal file
7
modules/nixos/core/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
imports = [
|
||||
./boot.nix
|
||||
./network.nix
|
||||
./user.nix
|
||||
];
|
||||
}
|
||||
5
modules/nixos/core/network.nix
Normal file
5
modules/nixos/core/network.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
config = {
|
||||
networking.networkmanager.enable = true;
|
||||
};
|
||||
}
|
||||
16
modules/nixos/core/user.nix
Normal file
16
modules/nixos/core/user.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
mods.user.name = lib.mkOption {
|
||||
default = "muon";
|
||||
description = "username of the main system user";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.${config.mods.user.name} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
initialPassword = "changeme";
|
||||
};
|
||||
};
|
||||
}
|
||||
7
modules/nixos/default.nix
Normal file
7
modules/nixos/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
imports = [
|
||||
./core
|
||||
./system
|
||||
./desktop
|
||||
];
|
||||
}
|
||||
15
modules/nixos/desktop/default.nix
Normal file
15
modules/nixos/desktop/default.nix
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
imports = [
|
||||
./xorg.nix
|
||||
./sound.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
mods.desktop.enable = lib.mkEnableOption "enables sound";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.desktop.enable {
|
||||
mods.xorg.enable = true;
|
||||
mods.sound.enable = true;
|
||||
};
|
||||
}
|
||||
12
modules/nixos/desktop/sound.nix
Normal file
12
modules/nixos/desktop/sound.nix
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
mods.sound.enable = lib.mkEnableOption "enables sound";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.sound.enable {
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
11
modules/nixos/desktop/xorg.nix
Normal file
11
modules/nixos/desktop/xorg.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
options = {
|
||||
mods.xorg.enable = lib.mkEnableOption "enables xorg";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mods.xorg.enable {
|
||||
services.xserver.enable = true;
|
||||
services.xserver.xkb.layout = "us";
|
||||
services.xserver.xkb.options = "caps:escape";
|
||||
};
|
||||
}
|
||||
7
modules/nixos/system/default.nix
Normal file
7
modules/nixos/system/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
imports = [
|
||||
./locale.nix
|
||||
./programs.nix
|
||||
./services.nix
|
||||
];
|
||||
}
|
||||
10
modules/nixos/system/locale.nix
Normal file
10
modules/nixos/system/locale.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
time.timeZone = "Etc/UTC";
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
console = if config.mods.xorg.enable then {
|
||||
useXkbConfig = true;
|
||||
} else {
|
||||
keymap = "us";
|
||||
};
|
||||
}
|
||||
11
modules/nixos/system/programs.nix
Normal file
11
modules/nixos/system/programs.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
vim
|
||||
wget
|
||||
];
|
||||
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
}
|
||||
3
modules/nixos/system/services.nix
Normal file
3
modules/nixos/system/services.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{ pkgs, lib, ... }: {
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue