From 239a4fc20804eab2aed6c40cf87430cea3ca26e0 Mon Sep 17 00:00:00 2001 From: itsscb Date: Tue, 14 May 2024 00:21:57 +0200 Subject: [PATCH] { "generation": 16, "date": "2024-05-13T21:23:16Z", "nixosVersion": "24.05pre625274.205781405197", "kernelVersion": "6.6.30", "configurationRevision": "", "specialisations": [ "*" ], "current": true } --- configuration.nix | 112 ++++++++++++++++++------------------- hardware-configuration.nix | 46 ++++++++------- home.nix | 5 +- nixos-rebuild.sh | 11 ++-- nixos-switch.log | 25 ++------- 5 files changed, 93 insertions(+), 106 deletions(-) diff --git a/configuration.nix b/configuration.nix index eb40cbc..af9e347 100644 --- a/configuration.nix +++ b/configuration.nix @@ -15,12 +15,8 @@ in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix - # inputs.home-manager.nixosModules.default - # (import "${home-manager}/nixos") - + (import "${sops}/modules/sops") - # Secrets Manager - # inputs.sops-nix.nixosModules.sops ]; # Bootloader. @@ -28,12 +24,14 @@ in { boot.loader.efi.canTouchEfiVariables = true; boot.initrd.luks.devices."luks-368f684f-d514-405f-a909-fb4488d19183".device = "/dev/disk/by-uuid/368f684f-d514-405f-a909-fb4488d19183"; - networking.hostName = "scbnb"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + nix.settings.experimental-features = ["nix-command" "flakes"]; - # Enable networking - networking.networkmanager.enable = true; + networking = { + hostName = "scbnb"; # Define your hostname. + networkmanager.enable = true; + # wireless.enable = true; # Enables wireless support via wpa_supplicant. + }; # Set your time zone. time.timeZone = "Europe/Berlin"; @@ -53,42 +51,41 @@ in { LC_TIME = "de_DE.UTF-8"; }; - - services.displayManager.sddm = { + services = { + displayManager.sddm = { enable = true; }; - services.xserver = { - enable = true; - desktopManager.gnome = { + xserver = { enable = true; + desktopManager.gnome = { + enable = true; + }; + + xkb = { + layout = "us"; + variant = ""; + }; + excludePackages = + (with pkgs; [ + nano + xterm + ]) + ++ (with pkgs.gnome; [ + cheese + gnome-music + epiphany + geary + totem + tali + iagno + hitori + atomix + ]); }; - xkb = { - layout = "us"; - variant = ""; - }; -excludePackages = - (with pkgs; [ - nano - xterm - ]) - ++ (with pkgs.gnome; [ - cheese - gnome-music - epiphany - geary - totem - tali - iagno - hitori - atomix - ]); - + # Enable CUPS to print documents. + printing.enable = true; }; - - # Enable CUPS to print documents. - services.printing.enable = true; - # Enable sound with pipewire. sound.enable = true; hardware.pulseaudio.enable = false; @@ -167,24 +164,23 @@ excludePackages = nvidia.modesetting.enable = true; }; - home-manager = { - # extraSpecialArgs = {inherit inputs;}; - backupFileExtension = "backup"; - users = { - "itsscb" = (import ./home.nix); - "root" = { - home.stateVersion = "23.11"; - home.file.".config/helix".source = ./dotfiles/helix; - programs.bash = { - enable = true; - shellAliases = { - ls = "eza -la --git"; - grep = "rg"; - cat = "bat"; - }; - }; - }; - }; + home-manager = { + backupFileExtension = "backup"; + users = { + "itsscb" = import ./home.nix; + "root" = { + home.stateVersion = "23.11"; + home.file.".config/helix".source = ./dotfiles/helix; + programs.bash = { + enable = true; + shellAliases = { + ls = "eza -la --git"; + grep = "rg"; + cat = "bat"; + }; + }; + }; + }; }; nixpkgs.config.allowUnfree = true; @@ -219,7 +215,7 @@ excludePackages = blueman ## Lockscreen - hyprlock + hyprlock ## Top Bar waybar diff --git a/hardware-configuration.nix b/hardware-configuration.nix index fc6ba7a..b8d1049 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -1,34 +1,38 @@ # 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") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "rtsx_pci_sdmmc" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "rtsx_pci_sdmmc"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; - fileSystems."/" = - { device = "/dev/disk/by-uuid/0ae6401b-0d05-468e-acff-76e7a5493d5e"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/0ae6401b-0d05-468e-acff-76e7a5493d5e"; + fsType = "ext4"; + }; boot.initrd.luks.devices."luks-df78403b-c8cf-406a-be4c-0b3af8697930".device = "/dev/disk/by-uuid/df78403b-c8cf-406a-be4c-0b3af8697930"; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D6DD-9639"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D6DD-9639"; + fsType = "vfat"; + options = ["fmask=0022" "dmask=0022"]; + }; - swapDevices = - [ { device = "/dev/disk/by-uuid/c5d6dba0-2418-4ba2-b7f0-af63e39e4a80"; } - ]; + swapDevices = [ + {device = "/dev/disk/by-uuid/c5d6dba0-2418-4ba2-b7f0-af63e39e4a80";} + ]; # 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 diff --git a/home.nix b/home.nix index 1822154..bf698f5 100644 --- a/home.nix +++ b/home.nix @@ -3,8 +3,7 @@ pkgs, inputs, ... -}: -{ +}: { home.username = "itsscb"; home.homeDirectory = "/home/itsscb"; @@ -27,7 +26,7 @@ size = 10; }; }; - + programs = { helix = { enable = true; diff --git a/nixos-rebuild.sh b/nixos-rebuild.sh index cdc25ff..27ba5d3 100755 --- a/nixos-rebuild.sh +++ b/nixos-rebuild.sh @@ -37,14 +37,17 @@ echo -n "NixOS - Testing new configuration..." # Rebuild, output simplified errors, log trackebacks sudo nixos-rebuild dry-build &>nixos-switch.log || (cat nixos-switch.log | grep --color error && exit 1) -echo -e 'KNixOS - Test passed. Adding files to git' +echo -e ': Test passed. Adding files to git' sudo git add * -echo -e "NixOS - Rebuilding..." +echo -n "NixOS - Rebuilding..." sudo nixos-rebuild switch &>nixos-switch.log || (cat nixos-switch.log | grep --color error && sudo git restore --staged ./**/*.nix && cd - && exit 1) -# Get current generation metadata -current=$(sudo nixos-rebuild list-generations | grep current) +echo -e ": Rebuild successful. Committing changes..." +# Get current generation metadata +current=$(nixos-rebuild list-generations --json | jq '.[0]') + +echo -e ": $current" # Commit all changes witih the generation metadata sudo git commit -am "$current" diff --git a/nixos-switch.log b/nixos-switch.log index 0fdab38..7237926 100644 --- a/nixos-switch.log +++ b/nixos-switch.log @@ -1,21 +1,6 @@ +building Nix... building the system configuration... -warning: Git tree '/etc/nixos' is dirty -these 18 derivations will be built: - /nix/store/p2mii7339mdzyhag4j8aagb5s65vrdjw-nixos-version.drv - /nix/store/a1y6yhslcq22mzppfl52v6i2hm3kl35d-system-path.drv - /nix/store/1xb5ppq4gmawds33yham45j6dryviavs-dbus-1.drv - /nix/store/djp4g9j80lay8rm7v6x4xvay99fl4bsi-etc-pam-environment.drv - /nix/store/i6mkwfapfyl3bl641wigg7wdi17czr5f-X-Restart-Triggers-dbus.drv - /nix/store/bj42hi6vj1nsgq2ii4qb4cx20kxamify-unit-dbus.service.drv - /nix/store/f3yqvzmmj1m9xnjb78xgpjz44yarg9vs-user-units.drv - /nix/store/qhsg5dbzhzjz2i2jkgp5lp6svdf34c23-set-environment.drv - /nix/store/q9g74j9a5qnmmr3b4lhrmc05cbx8490w-etc-profile.drv - /nix/store/86m52xgizinbwcx2xfh5z6plfxxi7fpl-unit-dbus.service.drv - /nix/store/c3vz0k0s1gzvs1l79yw225px2cr2ja5p-unit-home-manager-root.service.drv - /nix/store/cj40jri980wf7dw71lngq9g1g12spgzs-unit-accounts-daemon.service.drv - /nix/store/8npl4dnqq70aqwvz9jl1agyzrnx5rcv4-X-Restart-Triggers-polkit.drv - /nix/store/ljmaz0krqhji8hvz706v18qi5ard3l4a-unit-polkit.service.drv - /nix/store/s9c5qkb9wr57mb5pwmxmvfyy5lslhfwc-unit-home-manager-itsscb.service.drv - /nix/store/xg5b7v0ib84j559sxpff7y3z0ydpdw09-system-units.drv - /nix/store/7cabla1rgkh95qb9b2v7pvhlgsbfr1jm-etc.drv - /nix/store/m8k3s40fifzswnj10j9wrkrm99v8lvf4-nixos-system-scbnb-24.05.20240509.f1010e0.drv +activating the configuration... +setting up /etc... +reloading user units for itsscb... +restarting sysinit-reactivation.target