From a093970262412e22bca8faff66bbcb69071a66a9 Mon Sep 17 00:00:00 2001 From: xeovalyte Date: Tue, 10 Dec 2024 18:38:17 +0100 Subject: [PATCH] Updated configuration --- flake.lock | 214 ++++++++++++++--------------- flake.nix | 14 +- hosts/laptop/default.nix | 21 ++- hosts/laptop/home.nix | 2 +- justfile | 12 ++ modules/home/cli/common/shell.nix | 5 + modules/home/gui/common/fonts.nix | 3 +- modules/system/cli/common.nix | 2 + modules/system/gui/hyprland.nix | 18 +-- modules/system/hardware/amd.nix | 9 +- modules/system/hardware/fprint.nix | 1 + 11 files changed, 171 insertions(+), 130 deletions(-) create mode 100644 justfile diff --git a/flake.lock b/flake.lock index 08f0447..5248602 100644 --- a/flake.lock +++ b/flake.lock @@ -1,28 +1,5 @@ { "nodes": { - "apple-fonts": { - "inputs": { - "nixpkgs": "nixpkgs", - "ny": "ny", - "sf-arabic": "sf-arabic", - "sf-compact": "sf-compact", - "sf-mono": "sf-mono", - "sf-pro": "sf-pro" - }, - "locked": { - "lastModified": 1732029343, - "narHash": "sha256-sAOEhA/vfyAKggwyI3PNy2xeNzb/USZl4YNpeSzMRBI=", - "owner": "lyndeno", - "repo": "apple-fonts.nix", - "rev": "714767021b57d0d30de35eb90e4b748fbbb9c99f", - "type": "github" - }, - "original": { - "owner": "lyndeno", - "repo": "apple-fonts.nix", - "type": "github" - } - }, "base16-schemes": { "flake": false, "locked": { @@ -39,6 +16,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1717312683, + "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -46,11 +39,11 @@ ] }, "locked": { - "lastModified": 1732466619, - "narHash": "sha256-T1e5oceypZu3Q8vzICjv1X/sGs9XfJRMW5OuXHgpB3c=", + "lastModified": 1733572789, + "narHash": "sha256-zjO6m5BqxXIyjrnUziAzk4+T4VleqjstNudSqWcpsHI=", "owner": "nix-community", "repo": "home-manager", - "rev": "f3111f62a23451114433888902a55cf0692b408d", + "rev": "c7ffc9727d115e433fd884a62dc164b587ff651d", "type": "github" }, "original": { @@ -79,17 +72,54 @@ "type": "github" } }, - "nixpkgs": { + "nixos-cosmic": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable", + "rust-overlay": "rust-overlay" + }, "locked": { - "lastModified": 1731319897, - "narHash": "sha256-PbABj4tnbWFMfBp6OcUK5iGy1QY+/Z96ZcLpooIbuEI=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "dc460ec76cbff0e66e269457d7b728432263166c", + "lastModified": 1733708804, + "narHash": "sha256-PiUrztTiR4aVRC2fMdNcOWYWF1ojvqbrSUYmhtp3970=", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "rev": "1531210f371ecf966ff67e87975f684553bdbbf7", "type": "github" }, "original": { - "owner": "nixos", + "owner": "lilyinstarlight", + "repo": "nixos-cosmic", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1733481457, + "narHash": "sha256-IS3bxa4N1VMSh3/P6vhEAHQZecQ3oAlKCDvzCQSO5Is=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "e563803af3526852b6b1d77107a81908c66a9fcf", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", + "type": "github" + }, + "original": { + "owner": "NixOS", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" @@ -110,13 +140,29 @@ "type": "github" } }, - "nixpkgs-unstable": { + "nixpkgs-stable": { "locked": { - "lastModified": 1732521221, - "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=", + "lastModified": 1733412085, + "narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d", + "rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1733581040, + "narHash": "sha256-Qn3nPMSopRQJgmvHzVqPcE3I03zJyl8cSbgnnltfFDY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "22c3f2cf41a0e70184334a958e6b124fb0ce3e01", "type": "github" }, "original": { @@ -125,88 +171,38 @@ "type": "indirect" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1732350895, - "narHash": "sha256-GcOQbOgmwlsRhpLGSwZJwLbo3pu9ochMETuRSS1xpz4=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "0c582677378f2d9ffcb01490af2f2c678dcb29d3", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-24.11", - "type": "indirect" - } - }, - "ny": { - "flake": false, - "locked": { - "narHash": "sha256-3257NAH4qlan2YHVLpNRy7x8IJqR2pal3OzFo/ykqXs=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" - }, - "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/NY.dmg" - } - }, "root": { "inputs": { - "apple-fonts": "apple-fonts", "home-manager": "home-manager", "nix-colors": "nix-colors", - "nixpkgs": "nixpkgs_2", + "nixos-cosmic": "nixos-cosmic", + "nixos-hardware": "nixos-hardware", + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs-stable" + ], "nixpkgs-unstable": "nixpkgs-unstable" } }, - "sf-arabic": { - "flake": false, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixos-cosmic", + "nixpkgs" + ] + }, "locked": { - "narHash": "sha256-/0gjRimqvZyE60xYxxPdlU+7Q2LJnnvtbmwOP0YmS9U=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" + "lastModified": 1733625333, + "narHash": "sha256-tIML2axjm4AnlKP29upVJxzBpj4Cy4ak+PKonqQtXmc=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "430c8b054e45ea44fd2c9521a378306ada507a6c", + "type": "github" }, "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Arabic.dmg" - } - }, - "sf-compact": { - "flake": false, - "locked": { - "narHash": "sha256-J72Lyt2wy83E46wN8w6/Rih9kilM9wEjtY6KnbF0DsA=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" - }, - "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Compact.dmg" - } - }, - "sf-mono": { - "flake": false, - "locked": { - "narHash": "sha256-ICdHRFdNL7PM/fXJUzS7LgZxZiqcyIuCMHLze4En4vg=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" - }, - "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg" - } - }, - "sf-pro": { - "flake": false, - "locked": { - "narHash": "sha256-Q/pOQ4MGhW/ZtLka+UUQcwSoZFDWW34XvutxL4GvzUY=", - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" - }, - "original": { - "type": "file", - "url": "https://devimages-cdn.apple.com/design/resources/download/SF-Pro.dmg" + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index 781d477..6479679 100644 --- a/flake.nix +++ b/flake.nix @@ -11,11 +11,18 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nix-colors.url = "github:misterio77/nix-colors"; - apple-fonts.url = "github:lyndeno/apple-fonts.nix"; + + nixpkgs.follows = "nixos-cosmic/nixpkgs-stable"; + + nixos-cosmic = { + url = "github:lilyinstarlight/nixos-cosmic"; + }; }; - outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, apple-fonts, ... }: + outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-colors, nixos-cosmic, ... }: let system = "x86_64-linux"; overlay-unstable = final: prev: { @@ -34,6 +41,9 @@ modules = [ ({ config, pkgs, ... }: { nixpkgs.overlays = [ overlay-unstable ]; }) + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + nixos-cosmic.nixosModules.default + ./hosts/laptop ]; }; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 4a89c17..da6630b 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, inputs, ... }: { imports = [ @@ -15,7 +15,7 @@ ../../modules/system/cli/docker.nix # Hardware - ../../modules/system/hardware/amd.nix + # ../../modules/system/hardware/amd.nix ../../modules/system/hardware/bluetooth.nix ../../modules/system/hardware/firewall.nix ../../modules/system/hardware/garbage-collection.nix @@ -31,9 +31,16 @@ substituters = [ "https://nix-community.cachix.org" + "https://cosmic.cachix.org/" + ]; + + trusted-public-keys = [ + "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ]; }; + # Configure hardware + # Bootloader. boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub = { @@ -53,11 +60,21 @@ nix.settings.trusted-users = [ "root" "xeovalyte" ]; + # Enable cosmic desktop eenvironment + services.desktopManager.cosmic.enable = true; + services.displayManager.cosmic-greeter.enable = true; + + # Prevent system freeze on high load + services.earlyoom = { + enable = true; + }; + boot.kernelPackages = pkgs.linuxPackages_latest; # Configure wacom tablet hardware.opentabletdriver = { enable = true; + package = pkgs.unstable.opentabletdriver; }; services.libinput.enable = true; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 4fcb058..429e168 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -58,7 +58,7 @@ loupe unstable.rnote unstable.bottles - + resources # Office libreoffice diff --git a/justfile b/justfile new file mode 100644 index 0000000..455015e --- /dev/null +++ b/justfile @@ -0,0 +1,12 @@ +default: + @just --choose + +rebuild: + sudo nixos-rebuild switch --flake . + home-manager switch --flake . + +rebuild-system: + sudo nixos-rebuild switch --flake . + +rebuild-home-manager: + home-manager switch --flake . diff --git a/modules/home/cli/common/shell.nix b/modules/home/cli/common/shell.nix index 01a7aab..0fc40c1 100644 --- a/modules/home/cli/common/shell.nix +++ b/modules/home/cli/common/shell.nix @@ -26,4 +26,9 @@ enableBashIntegration = true; enableZshIntegration = true; }; + + programs.skim = { + enable = true; + enableZshIntegration = true; + }; } diff --git a/modules/home/gui/common/fonts.nix b/modules/home/gui/common/fonts.nix index 8171473..fc58e8a 100644 --- a/modules/home/gui/common/fonts.nix +++ b/modules/home/gui/common/fonts.nix @@ -1,4 +1,4 @@ -{ pkgs, inputs, ... }: +{ pkgs, ... }: { fonts.fontconfig.enable = true; @@ -10,6 +10,5 @@ dejavu_fonts roboto (nerdfonts.override { fonts = [ "DejaVuSansMono" ]; }) - inputs.apple-fonts.packages.${pkgs.system}.sf-pro ]; } diff --git a/modules/system/cli/common.nix b/modules/system/cli/common.nix index 9805725..fd66f19 100644 --- a/modules/system/cli/common.nix +++ b/modules/system/cli/common.nix @@ -8,6 +8,8 @@ btop git yazi + + just ]; environment.pathsToLink = [ "/share/zsh" ]; diff --git a/modules/system/gui/hyprland.nix b/modules/system/gui/hyprland.nix index b718491..a9b6b23 100644 --- a/modules/system/gui/hyprland.nix +++ b/modules/system/gui/hyprland.nix @@ -19,16 +19,16 @@ # }; # SDDM configuration - environment.systemPackages = with pkgs; [ - libsForQt5.qt5.qtquickcontrols2 - libsForQt5.qt5.qtgraphicaleffects - ]; + # environment.systemPackages = with pkgs; [ + # libsForQt5.qt5.qtquickcontrols2 + # libsForQt5.qt5.qtgraphicaleffects + # ]; - services.displayManager.sddm = { - enable = true; - wayland.enable = true; - theme = "${import ./sddm-theme.nix { inherit pkgs; }}"; - }; + # services.displayManager.sddm = { + # enable = true; + # wayland.enable = true; + # theme = "${import ./sddm-theme.nix { inherit pkgs; }}"; + # }; # Sound configuration hardware.pulseaudio.enable = false; diff --git a/modules/system/hardware/amd.nix b/modules/system/hardware/amd.nix index aa285ef..e85f44a 100644 --- a/modules/system/hardware/amd.nix +++ b/modules/system/hardware/amd.nix @@ -1,17 +1,16 @@ { pkgs, ... }: { - boot.initrd.kernelModules = [ "amdgpu" ]; + hardware.graphics = { + enable = true; + enable32Bit = true; + }; - hardware.graphics.enable = true; hardware.graphics.extraPackages = with pkgs; [ amdvlk - mesa.drivers ]; hardware.graphics.extraPackages32 = with pkgs; [ driversi686Linux.amdvlk ]; - - programs.gamemode.enable = true; } diff --git a/modules/system/hardware/fprint.nix b/modules/system/hardware/fprint.nix index ed90b20..2b2593c 100644 --- a/modules/system/hardware/fprint.nix +++ b/modules/system/hardware/fprint.nix @@ -4,4 +4,5 @@ services.fprintd.enable = true; security.pam.services.login.fprintAuth = false; + security.pam.services.cosmic-greeter.fprintAuth = false; }