From 8759e193ff1ff3c02937f71807e4a82bc302cde9 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Sat, 30 Nov 2024 23:36:53 +0100 Subject: [PATCH] sisko: Init new host --- flake.nix | 3 + home/base.nix | 3 + hosts/sisko/applications.nix | 10 ++++ hosts/sisko/configuration.nix | 40 ++++++++++++++ hosts/sisko/desktop.nix | 58 ++++++++++++++++++++ hosts/sisko/hardware-configuration.nix | 48 ++++++++++++++++ hosts/sisko/home.nix | 76 ++++++++++++++++++++++++++ 7 files changed, 238 insertions(+) create mode 100644 hosts/sisko/applications.nix create mode 100644 hosts/sisko/configuration.nix create mode 100644 hosts/sisko/desktop.nix create mode 100644 hosts/sisko/hardware-configuration.nix create mode 100644 hosts/sisko/home.nix diff --git a/flake.nix b/flake.nix index b0f9dac..815894a 100644 --- a/flake.nix +++ b/flake.nix @@ -97,6 +97,9 @@ # Web host malcolm = normalSys "malcolm" { }; + + # Home desktop + sisko = normalSys "sisko" { }; }; # Daily driver macbook diff --git a/home/base.nix b/home/base.nix index 1c938e8..dacff3d 100644 --- a/home/base.nix +++ b/home/base.nix @@ -41,6 +41,9 @@ name = "Felix Albrigtsen"; email = lib.mkDefault "felix@albrigtsen.it"; }; + safe = { + directory = "/config"; + }; }; ignores = [ "*~" diff --git a/hosts/sisko/applications.nix b/hosts/sisko/applications.nix new file mode 100644 index 0000000..39fba52 --- /dev/null +++ b/hosts/sisko/applications.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: +{ + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + }; + + environment.systemPackages = with pkgs; [ + ]; +} diff --git a/hosts/sisko/configuration.nix b/hosts/sisko/configuration.nix new file mode 100644 index 0000000..52206f1 --- /dev/null +++ b/hosts/sisko/configuration.nix @@ -0,0 +1,40 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ../../base.nix + ../../common/metrics-exporters.nix + ./hardware-configuration.nix + ./desktop.nix + ./applications.nix + ]; + + networking = { + hostName = "sisko"; + defaultGateway = "192.168.10.1"; + interfaces.enp14s0.ipv4 = { + addresses = [ + { address = "192.168.10.172"; prefixLength = 24; } + ]; + }; + hostId = "b716d781"; + }; + + hardware.bluetooth.enable = true; + + sops.defaultSopsFile = ../../secrets/sisko/sisko.yaml; + + environment.variables = { EDITOR = "vim"; }; + + nixpkgs.config = { + allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "copilot.vim" + "steam" + "steam-unwrapped" + ]; + }; + + system.stateVersion = "24.11"; +} + diff --git a/hosts/sisko/desktop.nix b/hosts/sisko/desktop.nix new file mode 100644 index 0000000..dc2ebce --- /dev/null +++ b/hosts/sisko/desktop.nix @@ -0,0 +1,58 @@ +{ config, pkgs, lib, ... }: +{ + # Video + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + # services.displayManager.ly.enable = true; + programs.hyprland = { + enable = true; + withUWSM = true; + xwayland.enable = true; + }; + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + + # Audio + services.pipewire = { + enable = true; + alsa.enable = true; + pulse.enable = true; + jack.enable = true; + }; + hardware.pulseaudio.enable = false; + + # Misc + fonts = { + fontDir.enable = true; + packages = with pkgs; [ + noto-fonts + noto-fonts-emoji + noto-fonts-cjk-sans + font-awesome + fira-code + hack-font + (nerdfonts.override { + fonts = [ + "Hack" + ]; + }) + ]; + }; + + environment.sessionVariables = { + NIXOS_OZONE_WL = "1"; + SSH_AUTH_SOCK = "/run/user/${toString config.users.users.felixalb.uid}/keyring/ssh"; + }; + + services.gnome.gnome-keyring.enable = true; + + home-manager.users.felixalb = { + services = { + dunst.enable = true; + }; + }; +} diff --git a/hosts/sisko/hardware-configuration.nix b/hosts/sisko/hardware-configuration.nix new file mode 100644 index 0000000..333d874 --- /dev/null +++ b/hosts/sisko/hardware-configuration.nix @@ -0,0 +1,48 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/60a70caf-ca37-488d-8c2a-98a7e9b67d84"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/60a70caf-ca37-488d-8c2a-98a7e9b67d84"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/60a70caf-ca37-488d-8c2a-98a7e9b67d84"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/12CE-A600"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ { + device = "/swapfile"; + size = 64*1024; + } ]; + + networking.useDHCP = lib.mkDefault false; + # networking.interfaces.enp14s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp15s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/sisko/home.nix b/hosts/sisko/home.nix new file mode 100644 index 0000000..aa8cf25 --- /dev/null +++ b/hosts/sisko/home.nix @@ -0,0 +1,76 @@ +{ pkgs, lib, ... }: + +{ + imports = [ + ./../../home/base.nix + ./../../home/alacritty.nix + ]; + + home.packages = with pkgs; [ + bc + catimg + chromium + dante + dig + element-desktop + hunspellDicts.en_US + hunspellDicts.nb_NO + jq + libreoffice + mpv + nixpkgs-2211.remmina + openssl + pwgen + unstable.tlclient + traceroute + virt-manager + w3m + + (unstable.python311.withPackages (ps: with ps; [ + numpy + pycryptodome + requests + ])) + ]; + + programs = { + aerc = { + enable = true; + package = pkgs.unstable.aerc; + }; + alacritty.enable = true; + firefox.enable = true; + rbw = { + enable = true; + settings = { + base_url = "https://pw.feal.no"; + email = "felix@albrigtsen.it"; + pinentry = pkgs.pinentry-gnome3; + }; + }; + rofi = { + enable = true; + theme = "iggy"; + }; + zsh = { + shellAliases."rebuild" = "sudo nixos-rebuild switch --flake /config"; + prezto.pmodules = [ "ssh" ]; + }; + + neovim.plugins = with pkgs.vimPlugins; [ copilot-vim ]; + }; + + xdg.mimeApps = { + enable = true; + + defaultApplications = { + "text/html" = "firefox.desktop"; + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/about" = "firefox.desktop"; + "x-scheme-handler/unknown" = "firefox.desktop"; + }; + }; + + home.stateVersion = "24.11"; +}