diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 0000000..7b2ce91 --- /dev/null +++ b/cachix.nix @@ -0,0 +1,13 @@ + +# WARN: this file will get overwritten by $ cachix use +{ pkgs, lib, ... }: + +let + folder = ./cachix; + toImport = name: value: folder + ("/" + name); + filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; + imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); +in { + inherit imports; + nix.settings.substituters = ["https://cache.nixos.org/"]; +} \ No newline at end of file diff --git a/cachix/nix-community.nix b/cachix/nix-community.nix new file mode 100644 index 0000000..4c03c1a --- /dev/null +++ b/cachix/nix-community.nix @@ -0,0 +1,13 @@ + +{ + nix = { + settings = { + substituters = [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; +} \ No newline at end of file diff --git a/configuration.nix b/configuration.nix index f67a201..9a85b6e 100644 --- a/configuration.nix +++ b/configuration.nix @@ -19,6 +19,7 @@ in imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./cachix.nix ]; # Enable nix flakes and nix-command tools @@ -31,17 +32,25 @@ in # Use the systemd-boot EFI boot loader. boot.loader.systemd-boot.enable = false; + boot.loader.systemd-boot.configurationLimit = 5; boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.efiSysMountPoint = "/boot"; - boot.loader.systemd-boot.configurationLimit = 5; boot.bootspec.enable = true; boot.lanzaboote = { enable = true; pkiBundle = "/etc/secureboot"; + settings = { + default = "@saved"; + console-mode = "max"; + }; + configurationLimit = 2; }; + services.fwupd.enable = true; + hardware.enableAllFirmware = true; + # Override kernel to latest boot.kernelPackages = pkgs.linuxPackages_latest; @@ -81,8 +90,10 @@ in # Enable the Plasma 5 Desktop Environment. services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - services.xserver.displayManager.defaultSession = "plasmawayland"; + # services.xserver.desktopManager.plasma5.enable = true; + services.xserver.desktopManager.plasma6.enable = true; + # services.xserver.displayManager.defaultSession = "plasmawayland"; + services.xserver.displayManager.defaultSession = "plasma"; # Configure keymap in X11 # services.xserver.xkb.layout = "us"; @@ -106,7 +117,7 @@ in # Enable Flatpak services.flatpak.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; + # xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ]; # Enable AppImage boot.binfmt.registrations.appimage = { @@ -118,13 +129,28 @@ in magicOrExtension = ''\x7fELF....AI\x02''; }; + # Force radv + environment.variables.AMD_VULKAN_ICD = "RADV"; + + hardware.opengl.extraPackages = [ + pkgs.amdvlk + ]; + + # To enable Vulkan support for 32-bit applications, also add: + hardware.opengl.extraPackages32 = [ + pkgs.driversi686Linux.amdvlk + ]; + # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; + programs.fish.enable = true; + # Define a user account. Don't forget to set a password with ‘passwd’. users.users.matt = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" ]; # Enable ‘sudo’ for the user. + shell = pkgs.fish; packages = with pkgs; [ firefox tree @@ -146,8 +172,18 @@ in sbctl gparted discover-wrapped + pciutils + papirus-icon-theme + + neofetch + gamescope + mangohud + goverlay + heroic ]; + programs.java.enable = true; + # Steam programs.steam = { enable = true; diff --git a/flake.lock b/flake.lock index fd690f3..21a3c5b 100644 --- a/flake.lock +++ b/flake.lock @@ -34,6 +34,22 @@ } }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1673956053, @@ -74,6 +90,24 @@ "inputs": { "systems": "systems" }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { "lastModified": 1681202837, "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", @@ -89,6 +123,28 @@ } }, "gitignore": { + "inputs": { + "nixpkgs": [ + "kde", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703887061, + "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { "inputs": { "nixpkgs": [ "lanzaboote", @@ -110,12 +166,32 @@ "type": "github" } }, + "kde": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1706731447, + "narHash": "sha256-VbsFKQZwtFH6+k4U/YjgF20Byhz4Z21kmoLcG5dV2M8=", + "owner": "nix-community", + "repo": "kde2nix", + "rev": "e7aded2df9d79e3c23c953bd6011b66ba2b87d98", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "kde2nix", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts", - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": [ "nixpkgs" ], @@ -139,21 +215,37 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705856552, - "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "lastModified": 1706672657, + "narHash": "sha256-API05c0SDZrmzz1wpqt/K3iCwlaOqDeDfZGp0YGQnek=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "rev": "632751bf0ceeefc74af7a9d2335ea923ad9c831a", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-unstable", + "ref": "nixos-unstable-small", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-stable": { + "locked": { + "lastModified": 1704874635, + "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_2": { "locked": { "lastModified": 1678872516, "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", @@ -169,6 +261,50 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": [ + "kde", + "flake-utils" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "kde", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1706424699, + "narHash": "sha256-Q3RBuOpZNH2eFA1e+IHgZLAOqDD9SKhJ/sszrL8bQD4=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "7c54e08a689b53c8a1e5d70169f2ec9e2a68ffaf", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pre-commit-hooks-nix": { "inputs": { "flake-compat": [ @@ -179,12 +315,12 @@ "lanzaboote", "flake-utils" ], - "gitignore": "gitignore", + "gitignore": "gitignore_2", "nixpkgs": [ "lanzaboote", "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable" + "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { "lastModified": 1681413034, @@ -202,8 +338,9 @@ }, "root": { "inputs": { + "kde": "kde", "lanzaboote": "lanzaboote", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" } }, "rust-overlay": { @@ -245,6 +382,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ce7888f..390b651 100644 --- a/flake.nix +++ b/flake.nix @@ -3,6 +3,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + kde.url = "github:nix-community/kde2nix"; # impermanence.url = "github:nix-community/impermanence"; lanzaboote = { url = "github:nix-community/lanzaboote/v0.3.0"; @@ -11,13 +12,14 @@ }; # outputs = { self, nixpkgs, impermanence, lanzaboote } @ inputs: { - outputs = { self, nixpkgs, lanzaboote } @ inputs: { + outputs = { self, nixpkgs, lanzaboote, kde } @ inputs: { nixosConfigurations = { "matt-nixos" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ # inputs.impermanence.nixosModules.impermanence inputs.lanzaboote.nixosModules.lanzaboote + inputs.kde.nixosModules.plasma6 ./configuration.nix # ./impermanence.nix ];