From abc28a07949f26c8d2afd1f73fd30cf428d2a40f Mon Sep 17 00:00:00 2001 From: "Emma@Rory" Date: Fri, 8 Sep 2023 15:01:16 +0200 Subject: Some refactoring work... --- flake.lock | 32 +++---- flake.nix | 2 +- hardware-configuration.nix | 41 +++++++++ host/RoryNix/configuration.nix | 193 +++++++++++++++++++++++------------------ modules/base.nix | 36 +++++--- 5 files changed, 190 insertions(+), 114 deletions(-) create mode 100644 hardware-configuration.nix diff --git a/flake.lock b/flake.lock index a5bf4dd..bf78e5a 100644 --- a/flake.lock +++ b/flake.lock @@ -130,11 +130,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1693895999, - "narHash": "sha256-yN1XVFltQxiwle833KCqWkZNfBuRLWkXyEnOD+ljoYY=", + "lastModified": 1694134858, + "narHash": "sha256-fG/ESauOGmiojKlpJG8gB62dJa5Wd+ZIuiDMKK/HD3g=", "owner": "nix-community", "repo": "home-manager", - "rev": "3c0e381fef63e4fbc6c3292c9e9cbcf479c01794", + "rev": "19c6a4081b14443420358262f8416149bd79561a", "type": "github" }, "original": { @@ -162,27 +162,27 @@ }, "nixpkgs-RoryNix": { "locked": { - "lastModified": 1688392541, - "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", + "lastModified": 1694048570, + "narHash": "sha256-PEQptwFCVaJ+jLFJgrZll2shQ9VI/7xVhrCYkJo8iIw=", "owner": "NixOs", "repo": "nixpkgs", - "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", + "rev": "4f77ea639305f1de0a14d9d41eef83313360638c", "type": "github" }, "original": { "owner": "NixOs", - "ref": "nixos-22.11", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-rory": { "locked": { - "lastModified": 1692044232, - "narHash": "sha256-KR+4xZq3+jU4q2gi6P86/7JlScSVzjZYD/FeYELQN84=", + "lastModified": 1694129307, + "narHash": "sha256-7B2tQzG3Nuj9tDJEem93SGsUl5fBq7c2wiEFZ1sdaFo=", "owner": "TheArcaneBrony", "repo": "nixpkgs", - "rev": "9a20648eb212d7c8d581ec7722ec41de5215e418", + "rev": "eea848e901b685afa7d209dd25f1c7b9c691bf21", "type": "github" }, "original": { @@ -194,11 +194,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1693565476, - "narHash": "sha256-ya00zHt7YbPo3ve/wNZ/6nts61xt7wK/APa6aZAfey0=", + "lastModified": 1693663421, + "narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "aa8aa7e2ea35ce655297e8322dc82bf77a31d04b", + "rev": "e56990880811a451abd32515698c712788be5720", "type": "github" }, "original": { @@ -210,11 +210,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1693663421, - "narHash": "sha256-ImMIlWE/idjcZAfxKK8sQA7A1Gi/O58u5/CJA+mxvl8=", + "lastModified": 1693985761, + "narHash": "sha256-K5b+7j7Tt3+AqbWkcw+wMeqOAWyCD1MH26FPZyWXpdo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e56990880811a451abd32515698c712788be5720", + "rev": "0bffda19b8af722f8069d09d8b6a24594c80b352", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e504fa0..205251b 100755 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ url = "github:TheArcaneBrony/nixpkgs/master"; }; nixpkgs-RoryNix = { - url = "github:NixOs/nixpkgs/nixos-22.11"; + url = "github:NixOs/nixpkgs/nixos-23.05"; }; botcore-v4 = { url = "gitlab:BotCore-Devs/BotCore-v4/staging"; diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..db87408 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 = [ "uhci_hcd" "ehci_pci" "ata_piix" "ahci" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/0b4aa781-1cbe-4e15-844b-2e90432106a6"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/7b5b60f1-38f6-482a-a17c-5bacda9ee7d5"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/de97c09e-fbe1-4e55-94bf-77ab880517b5"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp2s8.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp16s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "i686-linux"; + networking.enableIntel3945ABGFirmware = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/host/RoryNix/configuration.nix b/host/RoryNix/configuration.nix index 97030a3..a5dbf3b 100644 --- a/host/RoryNix/configuration.nix +++ b/host/RoryNix/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { imports = @@ -8,69 +8,79 @@ ]; boot = { - kernelPackages = pkgs.linuxPackages_latest; - loader = { - grub = { - enable = true; - version = 2; - device = "/dev/sda"; # nodev for EFI only - - # EFI - efiSupport = false; - efiInstallAsRemovable = false; - }; - }; - #readOnlyNixStore = false; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + grub = { + enable = true; + device = "/dev/sda"; # nodev for EFI only + # EFI + efiSupport = false; + efiInstallAsRemovable = false; + }; + }; + #readOnlyNixStore = false; }; networking = { - hostName = "RoryNix"; - networkmanager.enable = true; - wireless.enable = false; - - firewall = { - enable = false; - # allowedTCPPorts = [ ... ]; - # allowedUDPPorts = [ ... ]; - }; + hostName = "RoryNix"; + networkmanager.enable = true; + wireless.enable = false; + firewall = { + enable = false; + # allowedTCPPorts = [ ... ]; + # allowedUDPPorts = [ ... ]; + }; }; time.timeZone = "Europe/Brussels"; i18n.defaultLocale = "en_US.UTF-8"; services = { - xserver = { - enable = true; - videoDrivers = [ "intel" ]; - desktopManager.gnome.enable = true; - libinput.enable = true; - layout = "us"; - modules = [ pkgs.xorg.xf86videointel ]; - }; - gnome = { - - core-developer-tools.enable = false; - core-utilities.enable = false; - tracker-miners.enable = false; - tracker.enable = false; - }; - - printing.enable = false; - openssh = { - enable = true; - extraConfig = '' - MaxAuthTries 32 - ''; - #X11Forwarding = true; - }; + xserver = { + enable = true; + videoDrivers = [ "intel" ]; + desktopManager.gnome.enable = true; + libinput.enable = true; + layout = "us"; + modules = [ pkgs.xorg.xf86videointel ]; + }; + gnome = { + core-developer-tools.enable = false; + core-utilities.enable = false; + tracker-miners.enable = false; + tracker.enable = false; + sushi.enable = false; + rygel.enable = false; + gnome-user-share.enable = false; + gnome-remote-desktop.enable = false; + gnome-online-miners.enable = lib.mkForce false; + gnome-online-accounts.enable = false; + gnome-initial-setup.enable = false; + gnome-browser-connector.enable = false; + games.enable = false; + evolution-data-server.enable = lib.mkForce false; + at-spi2-core.enable = lib.mkForce false; + }; + printing.enable = false; + openssh = { + enable = true; + extraConfig = '' + MaxAuthTries 32 + ''; + }; + pipewire = { + enable = true; + audio.enable = true; + pulse.enable = true; + wireplumber.enable = true; + jack.enable = true; + alsa.enable = true; + }; }; - security.sudo.wheelNeedsPassword = false; - nixpkgs.config.allowUnfree = true; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; sound.enable = true; - hardware.pulseaudio.enable = true; + hardware.pulseaudio.enable = false; users.users = { Rory = { @@ -92,24 +102,27 @@ neofetch lnav pciutils - zsh - gnome-console - feh git - #lsd - #steam - #nerdfonts - #element-web - sshfs - cinnamon.nemo - firefox-bin - #chromiumDev + lsd + duf htop + btop udisks gparted kitty.terminfo glxinfo + jq + yq + pv + dig + cloud-utils + sshfs + cinnamon.nemo + firefox-bin + #epiphany + gnome-console + feh # Various extensions... # - Gnome #gnomeExtensions.vitals @@ -120,32 +133,31 @@ #gnomeExtensions.left-clock # - Vim vimPlugins.vim-nix + # - zsh + zsh + zsh-powerlevel10k + zsh-nix-shell + zsh-you-should-use + zsh-syntax-highlighting + zsh-completions + ]; fonts.fonts = with pkgs; [ (nerdfonts.override { fonts = [ "JetBrainsMono" ]; }) ]; -# nixpkgs.overlays = [ -# (self: super: { -# python3 = super.python3.override { -# packageOverrides = python-self: python-super: { -# markdown-it-py = python-super.markdown-it-py.overrideAttrs (oldAttrs: { -# doInstallCheck = false; -# }); -# }; -# }; -# haskellPackages = super.haskellPackages.override { -# overrides = haskellPackages-self: haskellPackages-super: { -# basement = haskellPackages-super.basement.overrideAttrs (oldAttrs: { -# patches = [ -# ./patches/haskell/basement/IntWord64.patch -# ]; -# }); -# }; -# }; -# } -# ) -# ]; - security.polkit.enable = true; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + }; + nixpkgs = { + config.allowUnfree = true; + }; + security = { + polkit.enable = true; + sudo.wheelNeedsPassword = false; + }; nix = { distributedBuilds = true; @@ -168,9 +180,20 @@ #ssh://Rory@192.168.0.3 x86_64-linux,i686-linux /home/Rory/.ssh/id_ed25519 12 1 - - - #registry.nixpkgs.flake = pkgs; nixPath = [ "nixpkgs=flake:nixpkgs" ]; + + settings.trusted-substituters = [ + "https://nix-community.cachix.org" + "https://cache.garnix.io" + "https://numtide.cachix.org" + ]; + settings.trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; + }; system.stateVersion = "22.11"; # DO NOT EDIT! - } diff --git a/modules/base.nix b/modules/base.nix index c89f963..7364dfa 100755 --- a/modules/base.nix +++ b/modules/base.nix @@ -6,12 +6,14 @@ ./packages/vim.nix ./users/Rory.nix ]; - boot.kernelParams = [ - "memory_hotplug.memmap_on_memory=1" - "memhp_default_state=online" - "net.core.default_qdisc=fq" - "net.ipv4.tcp_congestion_control=bbr" - ]; + boot = { + kernelParams = [ + "memory_hotplug.memmap_on_memory=1" + "memhp_default_state=online" + "net.core.default_qdisc=fq" + "net.ipv4.tcp_congestion_control=bbr" + ]; + } networking = { hostName = lib.mkDefault "Rory-nix-base"; firewall = { @@ -46,9 +48,10 @@ wget neofetch lnav - zsh + pciutils git lsd + duf htop btop #sshfs @@ -77,10 +80,19 @@ "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" ]; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - nix.settings.auto-optimise-store = true; - nixpkgs.config.allowUnfree = true; - security.sudo.wheelNeedsPassword = false; - security.polkit.enable = true; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + auto-optimise-store = true; + }; + }; + nixpkgs = { + config.allowUnfree = true; + }; + security = { + polkit.enable = true; + sudo.wheelNeedsPassword = false; + }; + system.stateVersion = "22.11"; # DO NOT EDIT! } -- cgit 1.4.1