Move common NixOS configuration to another module
This commit is contained in:
parent
0ebff98838
commit
07833fcdd4
4 changed files with 97 additions and 56 deletions
46
common/nixos.nix
Normal file
46
common/nixos.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ config, lib, pkgs, ... }: {
|
||||||
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||||
|
|
||||||
|
console = {
|
||||||
|
keyMap = lib.mkForce "dvorak-es";
|
||||||
|
useXkbConfig = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
enableRedistributableFirmware = true;
|
||||||
|
cpu.amd.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
|
users = {
|
||||||
|
defaultUserShell = pkgs.zsh;
|
||||||
|
users.avery = {
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
isNormalUser = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment = {
|
||||||
|
shells = with pkgs; [ zsh ];
|
||||||
|
systemPackages = with pkgs; [ git htop neovim ];
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
|
security = {
|
||||||
|
doas = {
|
||||||
|
enable = true;
|
||||||
|
extraRules = [{
|
||||||
|
users = [ "avery" ];
|
||||||
|
keepEnv = true;
|
||||||
|
persist = true;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
rtkit.enable = true;
|
||||||
|
sudo.enable = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.openssh.enable = true;
|
||||||
|
}
|
|
@ -18,7 +18,7 @@
|
||||||
totsugeki = nixpkgs.lib.nixosSystem {
|
totsugeki = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
# ./common/nixos.nix
|
./common/nixos.nix
|
||||||
./hosts/totsugeki/nixos.nix
|
./hosts/totsugeki/nixos.nix
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
|
@ -38,8 +38,9 @@
|
||||||
greatyamada = nixpkgs.lib.nixosSystem {
|
greatyamada = nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
# ./common/nixos.nix
|
./common/nixos.nix
|
||||||
./hosts/greatyamada/nixos.nix
|
./hosts/greatyamada/nixos.nix
|
||||||
|
./hosts/greatyamada/services
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1 +1,44 @@
|
||||||
|
{ config, lib, pkgs }: {
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-uuid/61050e8d-41c6-4c37-98a9-d8b0cdce6903";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "compress=zstd:15" ];
|
||||||
|
};
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-uuid/3397-A4FF";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
"/home" = {
|
||||||
|
device = "/dev/disk/by-uuid/61050e8d-41c6-4c37-98a9-d8b0cdce6903";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "compress=zstd:15" "subvol=/home" ];
|
||||||
|
}
|
||||||
|
"/mnt/Datos" = {
|
||||||
|
device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "compress=zstd:15" ];
|
||||||
|
}
|
||||||
|
"/mnt/Datos/music" = {
|
||||||
|
device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "compress=zstd:15" "subvol=/music" ];
|
||||||
|
}
|
||||||
|
"/var/www" = {
|
||||||
|
device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "compress=zstd:15" "subvol=/html" ];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
hostName = "greatyamada";
|
||||||
|
networkmanager.enable = true;
|
||||||
|
useDHCP = lib.mkDefault false;
|
||||||
|
};
|
||||||
|
|
||||||
|
time.timeZone = "UTC";
|
||||||
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
"/" = {
|
"/" = {
|
||||||
device = "/dev/disk/by-uuid/144857c7-877b-46c7-94d9-30a6d6d27cf0";
|
device = "/dev/disk/by-uuid/144857c7-877b-46c7-94d9-30a6d6d27cf0";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "compress=zstd:9" ];
|
options = [ "compress=zstd:15" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/boot" = {
|
"/boot" = {
|
||||||
|
@ -26,13 +26,13 @@
|
||||||
"/home" = {
|
"/home" = {
|
||||||
device = "/dev/disk/by-uuid/4bbd6139-7caa-4617-a94f-b185c5f6ca45";
|
device = "/dev/disk/by-uuid/4bbd6139-7caa-4617-a94f-b185c5f6ca45";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "compress=zstd:9" ];
|
options = [ "compress=zstd:15" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
"/mnt/Datos" = {
|
"/mnt/Datos" = {
|
||||||
device = "/dev/disk/by-uuid/994ef2bd-a9fb-4414-9a0a-19b150ffa452";
|
device = "/dev/disk/by-uuid/994ef2bd-a9fb-4414-9a0a-19b150ffa452";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "compress=zstd:9" "user" "x-systemd.automount" "exec" ];
|
options = [ "compress=zstd:15" "user" "x-systemd.automount" "exec" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -47,40 +47,11 @@
|
||||||
useDHCP = lib.mkDefault true;
|
useDHCP = lib.mkDefault true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
|
|
||||||
time.timeZone = "Europe/Madrid";
|
time.timeZone = "Europe/Madrid";
|
||||||
|
|
||||||
i18n.defaultLocale = "es_ES.UTF-8";
|
i18n.defaultLocale = "es_ES.UTF-8";
|
||||||
console = {
|
|
||||||
keyMap = lib.mkForce "dvorak-es";
|
|
||||||
useXkbConfig = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware = {
|
nixpkgs.config.allowUnfree = true;
|
||||||
enableRedistributableFirmware = true;
|
|
||||||
cpu.amd.updateMicrocode =
|
|
||||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs = {
|
|
||||||
config.allowUnfree = true;
|
|
||||||
hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
users = {
|
|
||||||
defaultUserShell = pkgs.zsh;
|
|
||||||
extraGroups.vboxusers.members = [ "avery" ];
|
|
||||||
users.avery = {
|
|
||||||
extraGroups = [ "wheel" ];
|
|
||||||
isNormalUser = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment = {
|
|
||||||
shells = with pkgs; [ zsh ];
|
|
||||||
systemPackages = with pkgs; [ htop libjxl neovim ];
|
|
||||||
};
|
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
@ -97,30 +68,11 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
|
||||||
hyprland.enable = true;
|
|
||||||
steam.enable = true;
|
|
||||||
zsh.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
|
||||||
};
|
};
|
||||||
|
|
||||||
security = {
|
|
||||||
doas = {
|
|
||||||
enable = true;
|
|
||||||
extraRules = [{
|
|
||||||
users = [ "avery" ];
|
|
||||||
keepEnv = true;
|
|
||||||
persist = true;
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
rtkit.enable = true;
|
|
||||||
sudo.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
greetd = {
|
greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -140,7 +92,6 @@
|
||||||
};
|
};
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
openssh.enable = true;
|
|
||||||
udisks2.enable = true;
|
udisks2.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue