From 0419359861f094b1600ffadeb7a42b331f61d899 Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Sun, 2 Jul 2023 10:28:50 +0000 Subject: [PATCH] Adding kernighan --- flake.nix | 10 +++++++ system/desktop-configuration.nix | 46 ++++++++++++++++++++++++++++++++ system/kernighan-hardware.nix | 24 +++++++++++++++++ system/kernighan.nix | 25 +++++++++++++++++ system/miyamoto.nix | 1 + system/ritchie.nix | 1 + system/shared-configuration.nix | 42 ----------------------------- system/thompson.nix | 1 + 8 files changed, 108 insertions(+), 42 deletions(-) create mode 100644 system/desktop-configuration.nix create mode 100644 system/kernighan-hardware.nix create mode 100644 system/kernighan.nix diff --git a/flake.nix b/flake.nix index 0667991..4019640 100644 --- a/flake.nix +++ b/flake.nix @@ -79,6 +79,16 @@ ./system/miyamoto.nix ]; }; + + kernighan = nixpkgs.lib.nixosSystem { # Pi home server + system = "aarch64-linux"; + + specialArgs.inputs = inputs; + + modules = [ + ./system/kernighan.nix + ]; + }; }; }; } diff --git a/system/desktop-configuration.nix b/system/desktop-configuration.nix new file mode 100644 index 0000000..a9ee82c --- /dev/null +++ b/system/desktop-configuration.nix @@ -0,0 +1,46 @@ +{ config, pkgs, inputs, ... }: + +{ + +# security.polkit.enable = true; +# systemd.user.services.polkit-gnome-authentication-agent-1 = { +# Unit.Description = "polkit-gnome-authentication-agent-1"; +# Service = { +# Type = "simple"; +# ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; +# Restart = "on-failure"; +# RestartSec = 1; +# TimeoutStopSec = 10; +# }; +# }; + + # Enable sound. + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + environment.systemPackages = [ + pkgs.wget + pkgs.tmux + pkgs.git + pkgs.pciutils + pkgs.pinentry-curses + pkgs.xdg-desktop-portal + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-kde + inputs.devenv.packages.x86_64-linux.devenv + ]; + + xdg.mime.enable = true; + xdg.mime.defaultApplications = { + "text/html" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; + "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; + }; +} diff --git a/system/kernighan-hardware.nix b/system/kernighan-hardware.nix new file mode 100644 index 0000000..d493d49 --- /dev/null +++ b/system/kernighan-hardware.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/system/kernighan.nix b/system/kernighan.nix new file mode 100644 index 0000000..f297b56 --- /dev/null +++ b/system/kernighan.nix @@ -0,0 +1,25 @@ + +{ config, pkgs, inputs, ... }: + +{ + imports = + [ + ./shared-configuration.nix + ./kernighan-hardware.nix + ]; + + networking.hostName = "kernighan"; + + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + + environment.systemPackages = with pkgs; [ + git + ]; + + networking.firewall.allowedTCPPorts = [ + 22 # SSH + 80 # HTTP + 443 # HTTPS + ]; +} diff --git a/system/miyamoto.nix b/system/miyamoto.nix index 913f050..768749c 100644 --- a/system/miyamoto.nix +++ b/system/miyamoto.nix @@ -5,6 +5,7 @@ imports = [ ./shared-configuration.nix + ./desktop-configuration.nix ./miyamoto-hardware.nix ]; diff --git a/system/ritchie.nix b/system/ritchie.nix index 4e2c502..257313d 100644 --- a/system/ritchie.nix +++ b/system/ritchie.nix @@ -14,6 +14,7 @@ in imports = [ ./shared-configuration.nix + ./desktop-configuration.nix ./desktop.nix ./ritchie-hardware.nix ./filesystem.nix diff --git a/system/shared-configuration.nix b/system/shared-configuration.nix index bd827c1..ef180c4 100644 --- a/system/shared-configuration.nix +++ b/system/shared-configuration.nix @@ -24,27 +24,6 @@ time.timeZone = "Europe/London"; -# security.polkit.enable = true; - systemd.user.services.polkit-gnome-authentication-agent-1 = { - Unit.Description = "polkit-gnome-authentication-agent-1"; - Service = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; - - # Enable sound. - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - }; - users.groups.tmux.gid = 1000; # Used for tmux pairing systemd.tmpfiles.rules = [ "d /var/tmux_share 2770 tsv tmux" @@ -75,18 +54,6 @@ hardware.bluetooth.enable = true; - environment.systemPackages = [ - pkgs.wget - pkgs.tmux - pkgs.git - pkgs.pciutils - pkgs.pinentry-curses - pkgs.xdg-desktop-portal - pkgs.xdg-desktop-portal-gtk - pkgs.xdg-desktop-portal-kde - inputs.devenv.packages.x86_64-linux.devenv - ]; - programs.gnupg.agent = { enable = true; enableSSHSupport = true; @@ -100,15 +67,6 @@ settings.PasswordAuthentication = false; }; - xdg.mime.enable = true; - xdg.mime.defaultApplications = { - "text/html" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/http" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/https" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop"; - "x-scheme-handler/unknown" = "org.qutebrowser.qutebrowser.desktop"; - }; - system.stateVersion = "22.11"; # Don't change this } diff --git a/system/thompson.nix b/system/thompson.nix index c719faf..9061ffe 100644 --- a/system/thompson.nix +++ b/system/thompson.nix @@ -14,6 +14,7 @@ in imports = [ ./shared-configuration.nix + ./desktop-configuration.nix ./desktop.nix ./thompson-hardware.nix ./filesystem.nix