diff --git a/cachix.nix b/cachix.nix new file mode 100644 index 0000000..ecd2d39 --- /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/"]; +} diff --git a/cachix/nix-community.nix b/cachix/nix-community.nix new file mode 100644 index 0000000..28de7e4 --- /dev/null +++ b/cachix/nix-community.nix @@ -0,0 +1,12 @@ +{ + nix = { + settings = { + substituters = [ + "https://nix-community.cachix.org" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; +} diff --git a/cachix/nix-gaming.nix b/cachix/nix-gaming.nix new file mode 100644 index 0000000..66d026d --- /dev/null +++ b/cachix/nix-gaming.nix @@ -0,0 +1,12 @@ +{ + nix = { + settings = { + substituters = [ + "https://nix-gaming.cachix.org" + ]; + trusted-public-keys = [ + "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" + ]; + }; + }; +} diff --git a/configuration.nix b/configuration.nix index 8ee6bf5..47052b0 100644 --- a/configuration.nix +++ b/configuration.nix @@ -33,6 +33,7 @@ NIXPKGS_ALLOW_UNFREE="1"; OMP_NUM_THREADS = "12"; MOZ_ENABLE_WAYLAND="1"; +# QT_QPA_PLATFORM="wayland-egl"; OCI_CLI_RC_FILE="/home/grimmauld/.oci/config"; }; diff --git a/flake.lock b/flake.lock index a5f7bb3..d7ed3a6 100644 --- a/flake.lock +++ b/flake.lock @@ -1,6 +1,22 @@ { "nodes": { "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, @@ -16,13 +32,140 @@ "type": "github" } }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1704982712, + "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "plasma6", + "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" + } + }, + "nix-gaming": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1705242731, + "narHash": "sha256-gfuMbiOPlPpl48jH8hGPY/zfaS3OTjdVN2cn450RTBg=", + "owner": "fufexan", + "repo": "nix-gaming", + "rev": "c41c0e5e4fbf942046512760dfa31e88c61d4347", + "type": "github" + }, + "original": { + "owner": "fufexan", + "repo": "nix-gaming", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1703255338, - "narHash": "sha256-Z6wfYJQKmDN9xciTwU3cOiOk+NElxdZwy/FiHctCzjU=", + "lastModified": 1704842529, + "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6df37dc6a77654682fe9f071c62b4242b5342e04", + "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1703961334, + "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "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_2": { + "locked": { + "lastModified": 1705133751, + "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", "type": "github" }, "original": { @@ -32,25 +175,91 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1705133751, + "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "plasma6": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3", + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1705232580, + "narHash": "sha256-OJHqtLx+VHgwJL8GcpDouQiwDybQ4mzwLwtXPG9QLqg=", + "owner": "nix-community", + "repo": "kde2nix", + "rev": "155d24c82dde0f4738f05760e5dfc1c13d84fe11", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "kde2nix", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": [ + "plasma6", + "flake-utils" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "plasma6", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1705229514, + "narHash": "sha256-itILy0zimR/iyUGq5Dgg0fiW8plRDyxF153LWGsg3Cw=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "ffa9a5b90b0acfaa03b1533b83eaf5dead819a05", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs", + "nix-gaming": "nix-gaming", + "nixpkgs": "nixpkgs_2", + "plasma6": "plasma6", "swayfx": "swayfx" } }, "swayfx": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1703225289, - "narHash": "sha256-1jRIcmRcdkdFM7LIur7eCFP9/E7fPmikZSvm9Sbfz/c=", + "lastModified": 1704454987, + "narHash": "sha256-vGc23vf8C1WIdaUgEs3XqvCU1ag5soQKZnytUsCRpEw=", "owner": "WillPower3309", "repo": "swayfx", - "rev": "ca42d414536c167f951e23bfc50d5edabb6f9dc2", + "rev": "f0ecffe593574593ec99c104fa12e4bfd593b0f2", "type": "github" }, "original": { @@ -58,6 +267,21 @@ "repo": "swayfx", "type": "github" } + }, + "systems": { + "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 3d5ca58..8dd9813 100644 --- a/flake.nix +++ b/flake.nix @@ -9,26 +9,32 @@ url = "github:WillPower3309/swayfx"; inputs.nixpkgs.follows = "nixpkgs"; }; + plasma6.url = "github:nix-community/kde2nix"; + nix-gaming.url = "github:fufexan/nix-gaming"; }; - outputs = inputs @ { self, nixpkgs, ... }: let + outputs = inputs @ { self, nix-gaming, nixpkgs, plasma6, swayfx, ... }: let system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - overlays = [self.overlays.default]; - }; + # pkg-overlays = import nixpkgs { + # inherit system; + # config.allowUnfree = true; + # overlays = [self.overlays.default]; + # }; in { - overlays.default = import ./overlay.nix {inherit inputs system;}; + # overlays.default = import ./overlay.nix {inherit inputs system;}; nixosConfigurations = { grimmauld-nixos = nixpkgs.lib.nixosSystem { inherit system; + specialArgs = { inherit inputs; }; modules = [ + # ({ config, pkgs, ... }: { nixpkgs.overlays = [ (import ./overlay.nix {inherit inputs system;} ) ]; }) + plasma6.nixosModules.default + nix-gaming.nixosModules.pipewireLowLatency # ./kernel.nix ./configuration.nix - ./modules/accessibility.nix +# ./modules/accessibility.nix ./modules/sway.nix ./modules/localisation.nix ./modules/users.nix @@ -45,8 +51,11 @@ ./modules/mypackaegsstayinstoreffs.nix ./modules/opengl.nix ./modules/kvm.nix + ./cachix.nix ]; }; }; + + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; }; } diff --git a/hardware-configuration.nix b/hardware-configuration.nix index 7cc1b13..23cd3ee 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -25,7 +25,10 @@ fsType = "vfat"; }; - swapDevices = [ ]; + swapDevices = [ { + device = "/var/lib/swapfile"; + size = 48*1024; + } ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; diff --git a/modules/printing.nix b/modules/printing.nix index 920cd47..1dd3274 100644 --- a/modules/printing.nix +++ b/modules/printing.nix @@ -10,7 +10,7 @@ services.printing.drivers = with pkgs; [ brgenml1lpr brgenml1cupswrapper ]; services.avahi = { enable = true; - nssmdns = true; + nssmdns4 = true; openFirewall = true; }; services.printing.cups-pdf.enable = true; diff --git a/modules/sway.nix b/modules/sway.nix index 0aae2bf..431d541 100644 --- a/modules/sway.nix +++ b/modules/sway.nix @@ -1,25 +1,25 @@ { config, lib, pkgs, modulesPath, inputs, system, ... }: { - nixpkgs.overlays = [ (final: prev: { sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: { - src = pkgs.fetchFromGitHub { - owner = "WillPower3309"; - repo = "swayfx"; - rev = "7c75b21933215348f28a2c788b174901ef13e267"; - sha256 = "sha256-SlfJ34TR+QdFPnTpyo/UON9RDxS3MfLU9tOabWHkknQ="; - }; - patches = - let - removePatches = [ - "LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM.patch" - ]; - in - builtins.filter - (patch: !builtins.elem (patch.name or null) removePatches) - (old.patches or [ ]); - - });}) - ]; +# nixpkgs.overlays = [ (final: prev: { sway-unwrapped = prev.sway-unwrapped.overrideAttrs (old: { +# src = pkgs.fetchFromGitHub { +# owner = "WillPower3309"; +# repo = "swayfx"; +# rev = "7c75b21933215348f28a2c788b174901ef13e267"; +# sha256 = "sha256-SlfJ34TR+QdFPnTpyo/UON9RDxS3MfLU9tOabWHkknQ="; +# }; +# patches = +# let +# removePatches = [ +# "LIBINPUT_CONFIG_ACCEL_PROFILE_CUSTOM.patch" +# ]; +# in +# builtins.filter +# (patch: !builtins.elem (patch.name or null) removePatches) +# (old.patches or [ ]); +# +# });}) +# ]; programs.sway = { diff --git a/modules/system-packages.nix b/modules/system-packages.nix index b62bc31..d8e2d45 100644 --- a/modules/system-packages.nix +++ b/modules/system-packages.nix @@ -21,7 +21,6 @@ in ] ++ (with pkgs; [ spice-gtk wget - xonsh tree git file @@ -33,10 +32,12 @@ in polkit-kde-agent skanpage cached-nix-shell + gnupg visualvm ffmpeg-full lm_sensors oci-cli + xcb-util-cursor imagemagick pypy3 @@ -54,6 +55,11 @@ export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0 export __GLX_VENDOR_LIBRARY_NAME=nvidia export __VK_LAYER_NV_optimus=NVIDIA_only exec "$@" +'') + + (writeShellScriptBin "rebuild" '' + sudo nixos-rebuild switch --flake /home/grimmauld/grimm-nixos-laptop '') ]); + programs.xonsh.enable = true; } diff --git a/modules/users.nix b/modules/users.nix index 515e076..dbe3707 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -2,6 +2,7 @@ { users.users.grimmauld = { isNormalUser = true; + shell = pkgs.xonsh; description = "grimmauld"; extraGroups = [ "networkmanager" "wheel" "input" "video" "lp" "scanner" "libvirtd" ]; packages = with pkgs; [ @@ -19,12 +20,27 @@ rmview krita spicetify-cli -(writeShellScriptBin "connectWG" '' -wg-quick up wg0 -'') -(writeShellScriptBin "disconnectWG" '' -wg-quick down wg0 -'') + prusa-slicer + freecad + openscad + blender ]; }; + programs.neovim = { + enable = true; + viAlias = true; + configure = { + customRC = '' + set number + set hidden + set nocompatible + ''; + packages.myVimPackage = with pkgs.vimPlugins; { + # loaded on launch + start = [ vim-nix vim-scala fugitive ]; + # manually loadable by calling `:packadd $plugin-name` + opt = [ ]; + }; + }; + }; } diff --git a/modules/xdg.nix b/modules/xdg.nix index 26b3101..5cf38fc 100644 --- a/modules/xdg.nix +++ b/modules/xdg.nix @@ -5,8 +5,8 @@ wlr.enable = true; extraPortals = with pkgs; [ xdg-desktop-portal-wlr - xdg-desktop-portal-kde - xdg-desktop-portal-gtk +# xdg-desktop-portal-kde +# xdg-desktop-portal-gtk ]; }; diff --git a/modules/xserver.nix b/modules/xserver.nix index 501a716..d9620fe 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -5,11 +5,11 @@ videoDrivers = ["nvidia"]; displayManager = { sddm.enable = true; - defaultSession = "plasmawayland"; + defaultSession = "plasma"; }; desktopManager = { plasma5.enable = true; - xfce.enable = true; +# xfce.enable = true; }; }; diff --git a/overlay.nix b/overlay.nix index 3ba0b7f..a5a2120 100644 --- a/overlay.nix +++ b/overlay.nix @@ -2,7 +2,7 @@ inputs, system, ... -}: final: prev: +}: final: prev: { # stable packages stable = import inputs.nixpkgs-stable {