diff --git a/common/nixos.nix b/common/nixos.nix new file mode 100644 index 0000000..e0159ce --- /dev/null +++ b/common/nixos.nix @@ -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; +} diff --git a/flake.nix b/flake.nix index f672586..5b651d0 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ totsugeki = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - # ./common/nixos.nix + ./common/nixos.nix ./hosts/totsugeki/nixos.nix home-manager.nixosModules.home-manager { @@ -38,8 +38,9 @@ greatyamada = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - # ./common/nixos.nix + ./common/nixos.nix ./hosts/greatyamada/nixos.nix + ./hosts/greatyamada/services ]; }; }; diff --git a/hosts/greatyamada/nixos.nix b/hosts/greatyamada/nixos.nix index 8d1c8b6..f6ddc59 100644 --- a/hosts/greatyamada/nixos.nix +++ b/hosts/greatyamada/nixos.nix @@ -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"; +} diff --git a/hosts/totsugeki/nixos.nix b/hosts/totsugeki/nixos.nix index 4e44e22..f762e51 100644 --- a/hosts/totsugeki/nixos.nix +++ b/hosts/totsugeki/nixos.nix @@ -15,7 +15,7 @@ "/" = { device = "/dev/disk/by-uuid/144857c7-877b-46c7-94d9-30a6d6d27cf0"; fsType = "btrfs"; - options = [ "compress=zstd:9" ]; + options = [ "compress=zstd:15" ]; }; "/boot" = { @@ -26,13 +26,13 @@ "/home" = { device = "/dev/disk/by-uuid/4bbd6139-7caa-4617-a94f-b185c5f6ca45"; fsType = "btrfs"; - options = [ "compress=zstd:9" ]; + options = [ "compress=zstd:15" ]; }; "/mnt/Datos" = { device = "/dev/disk/by-uuid/994ef2bd-a9fb-4414-9a0a-19b150ffa452"; 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; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - time.timeZone = "Europe/Madrid"; i18n.defaultLocale = "es_ES.UTF-8"; - console = { - keyMap = lib.mkForce "dvorak-es"; - useXkbConfig = true; - }; - hardware = { - 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 ]; - }; + nixpkgs.config.allowUnfree = true; fonts = { packages = with pkgs; [ @@ -97,30 +68,11 @@ }; }; - programs = { - hyprland.enable = true; - steam.enable = true; - zsh.enable = true; - }; - xdg.portal = { enable = true; 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 = { greetd = { enable = true; @@ -140,7 +92,6 @@ }; pulse.enable = true; }; - openssh.enable = true; udisks2.enable = true; };