From f2e54391907058d8463a4b1b725484f0f02f8d13 Mon Sep 17 00:00:00 2001 From: kat witch Date: Thu, 5 Nov 2020 16:26:51 +0000 Subject: [PATCH] Major refactor where Desktop is split into various profiles for more granularity. --- README.md | 33 +++++++++++++++-- configuration/common/default.nix | 8 +---- configuration/common/users.nix | 3 ++ configuration/desktop/default.nix | 35 ------------------- configuration/development/default.nix | 20 +++++++++++ configuration/gaming/default.nix | 14 ++++++++ configuration/gnome/default.nix | 26 ++++++++++++++ .../hosts/beltane/services/nginx.nix | 4 +-- configuration/hosts/beltane/services/znc.nix | 4 +-- configuration/hosts/default.nix | 4 +++ configuration/hosts/litha/configuration.nix | 28 +++++++++++++++ .../hosts/litha/hardware-configuration.nix | 31 ++++++++++++++++ configuration/hosts/samhain/configuration.nix | 3 ++ configuration/hosts/yule/configuration.nix | 3 ++ configuration/xfce/default.nix | 24 +++++++++++++ 15 files changed, 191 insertions(+), 49 deletions(-) create mode 100644 configuration/development/default.nix create mode 100644 configuration/gaming/default.nix create mode 100644 configuration/gnome/default.nix create mode 100644 configuration/hosts/litha/configuration.nix create mode 100644 configuration/hosts/litha/hardware-configuration.nix create mode 100644 configuration/xfce/default.nix diff --git a/README.md b/README.md index ccc0708b..b98782fb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,34 @@ -# Proto readme +# nix-ring + +One repository to deploy to them all! + +## Related commands for usage + +### SSH Problem solving + +For new deploys, the SSHOPTS="-p 22" when // kat is applied to a SSH host definition will be required. * export NIX_SSHOPTS="-p 62954" * export NIX_SSHOPTS="-p 22" + +### Deployment + * nix build -f . deploy.all && ./result -* nix build -f . deploy.$group && ./result -* nix build -f . deploy.$hostname && ./result +* nix build -f . deploy. && ./result +* nix build -f . deploy. && ./result + +## Systems + +* Beltane - Main server. +* Samhain - Desktop. +* Yule - Laptop. +* Litha - Backup laptop. +* Ostara - HTPC laptop, maybe. + +## To-do + +- [ ] Integrate Ostara into configurations. +- [ ] Secrets management for Beltane. +- [ ] Additional services configuration for Beltane (that isn't ) +- [ ] Migrate to something that isn't XFCE or GNOME for the laptop devices (likely Sway). +- [ ] Move Firefox configuration to be done using home-manager, maybe even going as far to NUR package things like 1password + tree style tabs(?) \ No newline at end of file diff --git a/configuration/common/default.nix b/configuration/common/default.nix index ca75fbb3..618e8006 100644 --- a/configuration/common/default.nix +++ b/configuration/common/default.nix @@ -18,7 +18,7 @@ in { ]; boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - boot.kernelParams = [ "quiet" ]; + #boot.kernelParams = [ "quiet" ]; nixpkgs.config = { allowUnfree = true; @@ -47,12 +47,6 @@ in { keyMap = "uk"; }; - fonts.fontconfig.enable = true; - fonts.fonts = [ - pkgs.nerdfonts - pkgs.corefonts - ]; - environment.systemPackages = with pkgs; [ smartmontools lm_sensors diff --git a/configuration/common/users.nix b/configuration/common/users.nix index 5ae0126a..65f7286f 100644 --- a/configuration/common/users.nix +++ b/configuration/common/users.nix @@ -71,6 +71,9 @@ "samhain" = { hostname = "192.168.1.135"; } // kat; + "litha" = { + hostname = "192.168.1.240"; + } // kat; "yule" = { hostname = "192.168.1.92"; } // kat; diff --git a/configuration/desktop/default.nix b/configuration/desktop/default.nix index a0dd3785..df5c2d5a 100644 --- a/configuration/desktop/default.nix +++ b/configuration/desktop/default.nix @@ -5,20 +5,6 @@ let unstable = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/ma mumble.speechdSupport = true; }; - hardware.opengl.driSupport32Bit = true; - hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; - hardware.pulseaudio.support32Bit = true; - - environment.systemPackages = [ - pkgs.php - pkgs.php74Packages.composer2 - ]; - - services.gvfs = { - enable = true; - package = pkgs.gnome3.gvfs; - }; - home-manager.users.kat = { home.packages = [ pkgs._1password @@ -30,12 +16,7 @@ let unstable = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/ma pkgs.lm_sensors pkgs.discord pkgs.tdesktop - pkgs.carnix - pkgs.rustc - pkgs.cargo - pkgs.steam pkgs.dino - pkgs.dconf2nix pkgs.nitrogen pkgs.terminator pkgs.appimage-run @@ -43,18 +24,6 @@ let unstable = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/ma pkgs.vscode pkgs.neofetch pkgs.htop - pkgs.jetbrains.clion - pkgs.jetbrains.idea-ultimate - pkgs.jetbrains.goland - pkgs.jetbrains.phpstorm - pkgs.gnome3.gnome-tweak-tool - pkgs.gnomeExtensions.caffeine - pkgs.gnomeExtensions.emoji-selector - pkgs.gnomeExtensions.gsconnect - pkgs.gnomeExtensions.dash-to-panel - pkgs.gnomeExtensions.appindicator - pkgs.gnomeExtensions.dash-to-dock - pkgs.gnomeExtensions.arc-menu ]; programs.fish = { @@ -82,10 +51,6 @@ let unstable = import ( fetchTarball https://github.com/NixOS/nixpkgs/archive/ma pkgs.corefonts ]; - services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome3.enable = true; - sound.enable = true; hardware.pulseaudio.enable = true; hardware.opengl.enable = true; diff --git a/configuration/development/default.nix b/configuration/development/default.nix new file mode 100644 index 00000000..b0799eb0 --- /dev/null +++ b/configuration/development/default.nix @@ -0,0 +1,20 @@ + +{ config, lib, pkgs, ... }: +{ + environment.systemPackages = [ + pkgs.php + pkgs.php74Packages.composer2 + ]; + + home-manager.users.kat = { + home.packages = [ + pkgs.jetbrains.clion + pkgs.jetbrains.idea-ultimate + pkgs.jetbrains.goland + pkgs.jetbrains.phpstorm + pkgs.carnix + pkgs.rustc + pkgs.cargo + ]; + }; +} \ No newline at end of file diff --git a/configuration/gaming/default.nix b/configuration/gaming/default.nix new file mode 100644 index 00000000..ecf34b39 --- /dev/null +++ b/configuration/gaming/default.nix @@ -0,0 +1,14 @@ + +{ config, lib, pkgs, ... }: +{ + hardware.opengl.driSupport32Bit = true; + hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ]; + hardware.pulseaudio.support32Bit = true; + + home-manager.users.kat = { + home.packages = [ + pkgs.steam + pkgs.steam-run + ]; + }; +} \ No newline at end of file diff --git a/configuration/gnome/default.nix b/configuration/gnome/default.nix new file mode 100644 index 00000000..f45c8518 --- /dev/null +++ b/configuration/gnome/default.nix @@ -0,0 +1,26 @@ + +{ config, lib, pkgs, ... }: +{ + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome3.enable = true; + + home-manager.users.kat = { + home.packages = [ + pkgs.dconf2nix + pkgs.gnome3.gnome-tweak-tool + pkgs.gnomeExtensions.caffeine + pkgs.gnomeExtensions.emoji-selector + pkgs.gnomeExtensions.gsconnect + pkgs.gnomeExtensions.dash-to-panel + pkgs.gnomeExtensions.appindicator + pkgs.gnomeExtensions.dash-to-dock + pkgs.gnomeExtensions.arc-menu + ]; + }; + + services.gvfs = { + enable = true; + package = pkgs.gnome3.gvfs; + }; +} \ No newline at end of file diff --git a/configuration/hosts/beltane/services/nginx.nix b/configuration/hosts/beltane/services/nginx.nix index 73a2374f..030a5c88 100644 --- a/configuration/hosts/beltane/services/nginx.nix +++ b/configuration/hosts/beltane/services/nginx.nix @@ -3,7 +3,7 @@ let common = { enableACME = true; forceSSL = true; -}; in { +}; secrets = import ../secrets.nix; in { services.nginx = { enable = true; recommendedGzipSettings = true; @@ -81,7 +81,7 @@ let common = { }; security.acme = { - email = "dorkdev99+acme@gmail.com"; + email = secrets.acme.email; acceptTerms = true; }; } \ No newline at end of file diff --git a/configuration/hosts/beltane/services/znc.nix b/configuration/hosts/beltane/services/znc.nix index de24e318..bff17399 100644 --- a/configuration/hosts/beltane/services/znc.nix +++ b/configuration/hosts/beltane/services/znc.nix @@ -15,8 +15,8 @@ let secrets = import ../secrets.nix; in { modules = [ "webadmin" "adminlog" ]; User.kat = { Admin = true; - Nick = "kat"; - AltNick = "katrin"; + Nick = secrets.znc.nick; + AltNick = secrets.znc.altNick; Network.freenode = { Server = "chat.freenode.net +6697 ${secrets.znc.freenode.password}"; Chan = secrets.znc.freenode.channels; diff --git a/configuration/hosts/default.nix b/configuration/hosts/default.nix index 52c6404a..77ece001 100644 --- a/configuration/hosts/default.nix +++ b/configuration/hosts/default.nix @@ -12,6 +12,10 @@ let ssh.host = "kat@samhain"; groups = [ "desktop" "personal" ]; }; + litha = { + ssh.host = "root@litha"; + groups = [ "desktop" "personal" ]; + }; }; pkgs = import {}; evalConfig = import ; diff --git a/configuration/hosts/litha/configuration.nix b/configuration/hosts/litha/configuration.nix new file mode 100644 index 00000000..e304f663 --- /dev/null +++ b/configuration/hosts/litha/configuration.nix @@ -0,0 +1,28 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../common + ../../desktop + ../../xfce + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "litha"; + + networking.useDHCP = false; + networking.interfaces.enp34s0.useDHCP = true; + networking.networkmanager.enable = true; + + system.stateVersion = "20.09"; + +} diff --git a/configuration/hosts/litha/hardware-configuration.nix b/configuration/hosts/litha/hardware-configuration.nix new file mode 100644 index 00000000..84cb0feb --- /dev/null +++ b/configuration/hosts/litha/hardware-configuration.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "usb_storage" "sd_mod" "sdhci_acpi" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/fa06ba90-ffc9-4ca6-b1cf-1205340a975e"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/BF39-2AA3"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/9c88235e-9705-4b80-a988-e95eda06124f"; } + ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/configuration/hosts/samhain/configuration.nix b/configuration/hosts/samhain/configuration.nix index eed8f339..adf604ac 100644 --- a/configuration/hosts/samhain/configuration.nix +++ b/configuration/hosts/samhain/configuration.nix @@ -6,6 +6,9 @@ ./hardware-configuration.nix ../../common ../../desktop + ../../gnome + ../../gaming + ../../development ]; boot.loader.systemd-boot.enable = true; diff --git a/configuration/hosts/yule/configuration.nix b/configuration/hosts/yule/configuration.nix index 9396fb99..b76a463a 100644 --- a/configuration/hosts/yule/configuration.nix +++ b/configuration/hosts/yule/configuration.nix @@ -6,6 +6,9 @@ ./hardware-configuration.nix ../../common ../../desktop + ../../gnome + ../../gaming + ../../development ]; boot.loader.systemd-boot.enable = true; diff --git a/configuration/xfce/default.nix b/configuration/xfce/default.nix new file mode 100644 index 00000000..3cf63eb1 --- /dev/null +++ b/configuration/xfce/default.nix @@ -0,0 +1,24 @@ + +{ config, lib, pkgs, ... }: +{ + services.xserver.enable = true; + services.xserver.displayManager.lightdm.enable = true; + services.xserver.desktopManager.xfce.enable = true; + services.gvfs = { + enable = true; + package = lib.mkForce pkgs.gnome3.gvfs; + }; + + home-manager.users.kat = { + home.packages = [ + pkgs.xfce.xfce4-terminal + pkgs.xfce.thunar + pkgs.xfce.orage + pkgs.xfce.xfce4-battery-plugin + pkgs.xfce.xfce4-sensors-plugin + pkgs.xfce.xfce4-pulseaudio-plugin + pkgs.xfce.xfce4-whiskermenu-plugin + pkgs.xfce.xfce4-screenshooter + ]; + }; +} \ No newline at end of file