diff --git a/README.md b/README.md new file mode 100644 index 0000000..a8df51b --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Kalle's NixOS Dotfiles + +## TODO: +Improve Hyprland module to be less verbose + diff --git a/assets/login_wallpaper.jpg b/assets/login_wallpaper.jpg new file mode 100644 index 0000000..ced1c02 Binary files /dev/null and b/assets/login_wallpaper.jpg differ diff --git a/flake.lock b/flake.lock index a3261b7..df690b5 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1738087375, - "narHash": "sha256-GLyNtU9A2VN22jNRHZ2OXuFfTJLh8uEVVt+ftsKUX0c=", + "lastModified": 1744557573, + "narHash": "sha256-XAyj0iDuI51BytJ1PwN53uLpzTDdznPDQFG4RwihlTQ=", "owner": "Aylur", "repo": "ags", - "rev": "a6a7a0adb17740f4c34a59902701870d46fbb6a4", + "rev": "3ed9737bdbc8fc7a7c7ceef2165c9109f336bff6", "type": "github" }, "original": { @@ -21,39 +21,6 @@ "type": "github" } }, - "aquamarine": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1742213273, - "narHash": "sha256-0l0vDb4anfsBu1rOs94bC73Hub+xEivgBAo6QXl2MmU=", - "owner": "hyprwm", - "repo": "aquamarine", - "rev": "484b732195cc53f4536ce4bd59a5c6402b1e7ccf", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "aquamarine", - "type": "github" - } - }, "astal": { "inputs": { "nixpkgs": [ @@ -62,11 +29,11 @@ ] }, "locked": { - "lastModified": 1737670815, - "narHash": "sha256-ZCxxshGN7XooabArcoGkYSNx5yVunqjKJi2aTv6cznI=", + "lastModified": 1742571008, + "narHash": "sha256-5WgfJAeBpxiKbTR/gJvxrGYfqQRge5aUDcGKmU1YZ1Q=", "owner": "aylur", "repo": "astal", - "rev": "127e9cdcbf173846a3c40ddc0abfbb038df48042", + "rev": "dc0e5d37abe9424c53dcbd2506a4886ffee6296e", "type": "github" }, "original": { @@ -75,78 +42,6 @@ "type": "github" } }, - "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": 1717312683, - "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=", - "owner": "nix-community", - "repo": "flake-compat", - "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "flake-compat", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "hyprland", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "grayjay": { - "inputs": { - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1743203987, - "narHash": "sha256-fA1qhxuaZsQODGXr+gQETYI0ow6ak8Vp1VSKv/+jsPs=", - "owner": "rishabh5321", - "repo": "grayjay-flake", - "rev": "eb64a22457766aeff5935ed72f91249e387520d3", - "type": "github" - }, - "original": { - "owner": "rishabh5321", - "repo": "grayjay-flake", - "type": "github" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -154,11 +49,11 @@ ] }, "locked": { - "lastModified": 1743136572, - "narHash": "sha256-uwaVrKgi6g1TUq56247j6QvvFtYHloCkjCrEpGBvV54=", + "lastModified": 1750127463, + "narHash": "sha256-K2xFtlD3PcKAZriOE3LaBLYmVfGQu+rIF4Jr1RFYR0Q=", "owner": "nix-community", "repo": "home-manager", - "rev": "1efd2503172016a6742c87b47b43ca2c8145607d", + "rev": "28eef8722d1af18ca13e687dbf485e1c653a0402", "type": "github" }, "original": { @@ -168,359 +63,50 @@ "type": "github" } }, - "hyprcursor": { + "home-manager_2": { "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], "nixpkgs": [ - "hyprland", + "zen-browser", "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" ] }, "locked": { - "lastModified": 1742215578, - "narHash": "sha256-zfs71PXVVPEe56WEyNi2TJQPs0wabU4WAlq0XV7GcdE=", - "owner": "hyprwm", - "repo": "hyprcursor", - "rev": "2fd36421c21aa87e2fe3bee11067540ae612f719", + "lastModified": 1743604125, + "narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a", "type": "github" }, "original": { - "owner": "hyprwm", - "repo": "hyprcursor", - "type": "github" - } - }, - "hyprgraphics": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1739049071, - "narHash": "sha256-3+7TpXMrbsUXSwgr5VAKAnmkzMb6JO+Rvc9XRb5NMg4=", - "owner": "hyprwm", - "repo": "hyprgraphics", - "rev": "175c6b29b6ff82100539e7c4363a35a02c74dd73", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprgraphics", - "type": "github" - } - }, - "hyprland": { - "inputs": { - "aquamarine": "aquamarine", - "hyprcursor": "hyprcursor", - "hyprgraphics": "hyprgraphics", - "hyprland-protocols": "hyprland-protocols", - "hyprland-qtutils": "hyprland-qtutils", - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_2", - "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1743207575, - "narHash": "sha256-bNz2WfcZAF6hZkcEcRYFsoh49wNAamphS+NOhSrf5A0=", - "owner": "hyprwm", - "repo": "hyprland", - "rev": "7374a023eff964817c9e5fbe75a661540516f798", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1738422629, - "narHash": "sha256-5v+bv75wJWvahyM2xcMTSNNxmV8a7hb01Eey5zYnBJw=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "755aef8dab49d0fc4663c715fa4ad221b2aedaed", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "hyprland-qt-support": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprland-qtutils", - "hyprlang" - ], - "nixpkgs": [ - "hyprland", - "hyprland-qtutils", - "nixpkgs" - ], - "systems": [ - "hyprland", - "hyprland-qtutils", - "systems" - ] - }, - "locked": { - "lastModified": 1737634706, - "narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=", - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "rev": "8810df502cdee755993cb803eba7b23f189db795", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "type": "github" - } - }, - "hyprland-qtutils": { - "inputs": { - "hyprland-qt-support": "hyprland-qt-support", - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprland-qtutils", - "hyprlang", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1739048983, - "narHash": "sha256-REhTcXq4qs3B3cCDtLlYDz0GZvmsBSh947Ub6pQWGTQ=", - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "rev": "3504a293c8f8db4127cb0f7cfc1a318ffb4316f8", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1741191527, - "narHash": "sha256-kM+11Nch47Xwfgtw2EpRitJuORy4miwoMuRi5tyMBDY=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "72df3861f1197e41b078faa3e38eedd60e00018d", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1741534688, - "narHash": "sha256-EV3945SnjOCuRVbGRghsWx/9D89FyshnSO1Q6/TuQ14=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "dd1f720cbc2dbb3c71167c9598045dd3261d27b3", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprwayland-scanner": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1739870480, - "narHash": "sha256-SiDN5BGxa/1hAsqhgJsS03C3t2QrLgBT8u+ENJ0Qzwc=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "206367a08dc5ac4ba7ad31bdca391d098082e64b", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, - "nixos-cosmic": { - "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": [ - "nixpkgs" - ], - "nixpkgs-stable": "nixpkgs-stable", - "rust-overlay": "rust-overlay" - }, - "locked": { - "lastModified": 1743246566, - "narHash": "sha256-arEFUDLjADYIZ7T6PZX1yLOnfMoZ1ByebtmPuvV98+s=", - "owner": "lilyinstarlight", - "repo": "nixos-cosmic", - "rev": "c709db4b95e58f410978bb49c87cb74214d03e78", - "type": "github" - }, - "original": { - "owner": "lilyinstarlight", - "repo": "nixos-cosmic", + "owner": "nix-community", + "repo": "home-manager", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1743095683, - "narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=", - "owner": "NixOS", + "lastModified": 1749794982, + "narHash": "sha256-Kh9K4taXbVuaLC0IL+9HcfvxsSUx8dPB5s5weJcc9pc=", + "owner": "nixos", "repo": "nixpkgs", - "rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6", + "rev": "ee930f9755f58096ac6e8ca94a1887e0534e2d81", "type": "github" }, "original": { - "owner": "NixOS", + "owner": "nixos", "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } }, - "nixpkgs-stable": { - "locked": { - "lastModified": 1742937945, - "narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.11", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_2": { "locked": { - "lastModified": 1742669843, - "narHash": "sha256-G5n+FOXLXcRx+3hCJ6Rt6ZQyF1zqQ0DL0sWAMn2Nk0w=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1e5b653dff12029333a6546c11e108ede13052eb", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1743095683, - "narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=", + "lastModified": 1743448293, + "narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_4": { - "locked": { - "lastModified": 1742288794, - "narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", + "rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3", "type": "github" }, "original": { @@ -549,11 +135,11 @@ "plugin-rainbow-delimiters-nvim": { "flake": false, "locked": { - "lastModified": 1742829650, - "narHash": "sha256-sQAVw+9bKmJzX/MHA/vcmvzL+Q5kyWpDfPJ97efxQxE=", + "lastModified": 1744834150, + "narHash": "sha256-EeJvGtBwZgR7i9PEnGe4NTRiDQCgVKkSh5t8Xy5EYfE=", "owner": "HiPhish", "repo": "rainbow-delimiters.nvim", - "rev": "de39919a57e1a40a4c7dc5bae0de276f9c616ef3", + "rev": "55ad4fb76ab68460f700599b7449385f0c4e858e", "type": "gitlab" }, "original": { @@ -578,130 +164,28 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "hyprland", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1742649964, - "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "ags": "ags", - "grayjay": "grayjay", "home-manager": "home-manager", - "hyprland": "hyprland", - "nixos-cosmic": "nixos-cosmic", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs", "plugin-harpoon1": "plugin-harpoon1", "plugin-rainbow-delimiters-nvim": "plugin-rainbow-delimiters-nvim", "plugin-undotree-nvim": "plugin-undotree-nvim", "zen-browser": "zen-browser" } }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixos-cosmic", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1743215516, - "narHash": "sha256-52qbrkG65U1hyrQWltgHTgH4nm0SJL+9TWv2UDCEPNI=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "524463199fdee49338006b049bc376b965a2cfed", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "xdph": { - "inputs": { - "hyprland-protocols": [ - "hyprland", - "hyprland-protocols" - ], - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1741934139, - "narHash": "sha256-ZhTcTH9FoeAtbPfWGrhkH7RjLJZ7GeF18nygLAMR+WE=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "150b0b6f52bb422a1b232a53698606fe0320dde0", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" - } - }, "zen-browser": { "inputs": { - "nixpkgs": "nixpkgs_4" + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1743216975, - "narHash": "sha256-29xgm8F3DCcTNrQZ9V3Pwj6BkjalkKvGyjd+sF9/+3k=", + "lastModified": 1750152169, + "narHash": "sha256-XN5OBCCXKmPBL+UXyyScI5HGgs4U8OFGQTnKuxurBFI=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "165ee672e6b17a8bcc0a3fb51fab3f79715cc1f3", + "rev": "ed811ab0d0b407b59cda1023820e9986fd28c8c3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c7f82a4..80b4e8f 100644 --- a/flake.nix +++ b/flake.nix @@ -12,9 +12,6 @@ # Zen browser zen-browser.url = "github:0xc000022070/zen-browser-flake"; - # Grayjay - grayjay.url = "github:rishabh5321/grayjay-flake"; - # AGS ags.url = "github:Aylur/ags"; ags.inputs.nixpkgs.follows = "nixpkgs"; @@ -28,39 +25,46 @@ plugin-harpoon1.url = "github:ThePrimeagen/harpoon"; plugin-harpoon1.flake = false; - - hyprland.url = "github:hyprwm/hyprland"; - - nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic"; - nixos-cosmic.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { self, nixpkgs, - home-manager, ... }@inputs: let inherit (self) outputs; + lib = nixpkgs.lib; + + rootRel = path: ./. + ("/" + path); + moduleRel = map (path: rootRel ("modules/" + path)); + assetRel = path: rootRel ("assets/" + path); + + createSystemConfig = + hostname: + lib.nixosSystem { + specialArgs = { + inherit + inputs + outputs + rootRel + moduleRel + assetRel + hostname + ; + }; + modules = [ + ./hosts/_base + ./hosts/${hostname} + ]; + }; in { overlays = import ./overlays { inherit inputs; }; - - nixosConfigurations = { - "kalle-pc" = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs; - }; - modules = [ ./hosts/kalle-pc ]; - }; - "kalle-laptop" = nixpkgs.lib.nixosSystem { - specialArgs = { - inherit inputs outputs; - }; - modules = [ ./hosts/kalle-laptop ]; - }; - }; + nixosConfigurations = lib.genAttrs [ + "kalle-pc" + "kalle-laptop" + ] createSystemConfig; }; } diff --git a/hosts/_base/default.nix b/hosts/_base/default.nix index 922486e..96040e5 100644 --- a/hosts/_base/default.nix +++ b/hosts/_base/default.nix @@ -1,12 +1,18 @@ { inputs, pkgs, + hostname, + moduleRel, ... }: { - imports = [ - inputs.home-manager.nixosModules.home-manager - ]; + imports = + [ + inputs.home-manager.nixosModules.home-manager + ] + ++ moduleRel [ + "_base" + ]; nix.settings = { # Enable flakes and new 'nix' command @@ -27,15 +33,38 @@ # Select internationalisation properties. i18n.defaultLocale = "en_US.UTF-8"; + time.timeZone = "Europe/Amsterdam"; console = { font = "Lat2-Terminus16"; useXkbConfig = true; # use xkbOptions in tty. }; + services.xserver = { + enable = true; + xkb.layout = "us"; + }; + + # All my systems are systemd-boot + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Use network manager to manage networks + networking.networkmanager.enable = true; + networking.hostName = hostname; + + # Disable firewall. + networking.firewall.enable = false; + # Enable CUPS to print documents. services.printing.enable = true; + services.gvfs.enable = true; + + # Enable bluetooth. If no bluetooth adapter is present, this does nothing. + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; + # Enable sound. security.rtkit.enable = true; services.pipewire = { @@ -48,6 +77,8 @@ environment.systemPackages = with pkgs; [ xdg-user-dirs + cachix + usbutils ]; fonts = { @@ -101,35 +132,6 @@ }; programs.home-manager.enable = true; - - # TODO: Make this be based on the system wide style - gtk = { - enable = true; - theme = { - name = "Adwaita-dark"; - package = pkgs.gnome-themes-extra; - }; - iconTheme = { - name = "breeze-dark"; - package = pkgs.kdePackages.breeze-icons; - }; - cursorTheme = { - name = "breeze_cursors"; - package = pkgs.libsForQt5.breeze-qt5; - }; - }; - qt = { - enable = true; - style.name = "breeze"; - }; - dconf = { - enable = true; - settings = { - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; - }; - }; }; services.openssh.enable = true; diff --git a/hosts/kalle-laptop/default.nix b/hosts/kalle-laptop/default.nix index 36d1a30..c6cd683 100644 --- a/hosts/kalle-laptop/default.nix +++ b/hosts/kalle-laptop/default.nix @@ -2,44 +2,27 @@ inputs, config, pkgs, + moduleRel, ... }: { - imports = [ - ../_base - ./hardware-configuration.nix + imports = + [ + ./hardware-configuration.nix + ] + ++ moduleRel [ + "sddm.nix" + "plasma.nix" - ../../modules/sddm.nix - ../../modules/plasma.nix + "bash.nix" + "kitty.nix" + "git.nix" + "direnv.nix" + "firefox.nix" + "nvim" + ]; - ../../modules/bash.nix - ../../modules/kitty.nix - ../../modules/git.nix - ../../modules/direnv.nix - ../../modules/firefox.nix - ../../modules/nvim - ]; - - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - networking.hostName = "kalle-laptop"; - networking.networkmanager.enable = true; - - time.timeZone = "Europe/Amsterdam"; - - services.xserver = { - enable = true; - xkb.layout = "us"; - xkb.options = "eurosign:e,caps:escape"; - }; - - # Enable bluetooth - hardware.bluetooth.enable = true; - hardware.bluetooth.powerOnBoot = true; - - # Disable firewall. - networking.firewall.enable = false; + services.xserver.xkb.options = "eurosign:e,caps:escape"; home-manager.users.kalle = { home.packages = with pkgs; [ @@ -56,8 +39,6 @@ difftastic sops obsidian - - cachix ]; }; diff --git a/hosts/kalle-pc/default.nix b/hosts/kalle-pc/default.nix index 402c568..c1de29e 100644 --- a/hosts/kalle-pc/default.nix +++ b/hosts/kalle-pc/default.nix @@ -1,56 +1,70 @@ { inputs, - config, pkgs, + moduleRel, ... }: { - imports = [ - ../_base - ./hardware-configuration.nix - ./hardware-configuration.override.nix + imports = + [ + ./hardware-configuration.nix + ./hardware-configuration.override.nix + ] + ++ moduleRel [ + # Roles + "desktop" + "development" + "gaming" - ../../modules/sddm.nix - ../../modules/hyprland.nix - ../../modules/hyprpaper.nix + # Desktop environment + "hyprland" + "theming" + "sddm.nix" - ../../modules/bash.nix - ../../modules/kitty.nix - ../../modules/git.nix - ../../modules/direnv.nix - ../../modules/firefox.nix - ../../modules/zen-browser.nix - ../../modules/steam.nix - ../../modules/nvim - ../../modules/ags - ../../modules/grayjay.nix - ../../modules/signal.nix - ]; + # Communication + "signal.nix" + "discord.nix" - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + # Browsers - Yes I need them all + "browsers/firefox.nix" + "browsers/zen-browser.nix" + "browsers/chromium.nix" + + # Hardware + "hardware/zsa.nix" + ]; services.btrfs.autoScrub.enable = true; - networking.hostName = "kalle-pc"; - networking.networkmanager.enable = true; + monitors = [ + { + isPrimary = true; + name = "DP-2"; + width = 1920; + height = 1080; + refreshRate = 144; + x = 1080; + y = 420; + vrr = true; + } - time.timeZone = "Europe/Amsterdam"; + { + name = "HDMI-A-2"; + width = 1920; + height = 1080; + x = 0; + y = 0; + transform = "counterclockwise"; + } - services.xserver = { - enable = true; - xkb.layout = "us"; - }; - - services.gvfs.enable = true; - # Allow flashing ZSA keyboards - hardware.keyboard.zsa.enable = true; - # No need for firewall, since this machine is always at home - networking.firewall.enable = false; - - # ROCm support - hardware.graphics.extraPackages = with pkgs; [ - rocmPackages.clr.icd + { + name = "HDMI-A-1"; + width = 1920; + height = 1080; + x = 1080 + 1920; + y = 0; + transform = "clockwise"; + } ]; hyprland = @@ -61,50 +75,28 @@ in { mod = mod; - primaryMonitor = "DP-2"; - monitors = [ - { - name = "DP-2"; - width = 1920; - height = 1080; - refreshRate = 144; - x = 1080; - y = 420; - vrr = 1; - } - - { - name = "HDMI-A-2"; - width = 1920; - height = 1080; - x = 0; - y = 0; - transform = 3; - } - - { - name = "HDMI-A-1"; - width = 1920; - height = 1080; - x = 1080 + 1920; - y = 0; - transform = 1; - } - ]; autoStart = [ "uwsm-app -- ags run" - (mkUwsmApp inputs.zen-browser.packages.x86_64-linux.default "zen") + (mkUwsmApp inputs.zen-browser.packages.x86_64-linux.default "zen-beta") (mkUwsmApp pkgs.discord "discord") ]; - binds = { - "${mod}, return" = "exec, ${mkUwsmApp pkgs.kitty "kitty"}"; - "${mod}, E" = "exec, ${pkgs.ulauncher}/bin/ulauncher-toggle #wofi --show drun"; - "${mod}, Print" = "exec, ${pkgs.bash}/bin/bash -c \"grim -g \\\"$(slurp)\\\" - | wl-copy\""; - # Clipboard history - # bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy - }; + binds = + let + grimPre = "${pkgs.grimblast}/bin/grimblast --freeze"; + in + { + "${mod}, return" = "exec, ${mkUwsmApp pkgs.kitty "kitty"}"; + "${mod}, E" = "exec, ${pkgs.ulauncher}/bin/ulauncher-toggle #wofi --show drun"; + ", Print" = "exec, ${grimPre} copy area"; + "SHIFT, Print" = "exec, ${grimPre} copy output"; + "CTRL, Print" = "exec, ${grimPre} copy screen"; + "${mod}, Print" = "exec, ${pkgs.hyprpicker}/bin/hyprpicker -anf hex"; + + # Clipboard history + # bind = $mainMod, V, exec, cliphist list | wofi --dmenu | cliphist decode | wl-copy + }; sensitivity = 0.1; @@ -126,7 +118,7 @@ "dimaround" ]; # Auto workspace - "class:zen" = [ "workspace 1 silent" ]; + "class:zen-beta" = [ "workspace 1 silent" ]; "class:discord" = [ "workspace name:HDMI-A-1" ]; }; @@ -135,47 +127,21 @@ home-manager.users.kalle = { home.packages = with pkgs; [ - discord - discord-canary - vesktop - chromium - httpie - kdePackages.kate - kdePackages.dolphin - kdePackages.ark - kdePackages.filelight - rustup - gcc - prismlauncher - pavucontrol - difftastic - sops unzip - vlc - feishin - cachix - torzu - jq podman ]; }; - # NOTE: For debugging staging server configs - networking.extraHosts = '' - 192.168.10.99 staging.kallestruik.nl - 192.168.10.99 service1.staging.kallestruik.nl - 192.168.10.99 service2.staging.kallestruik.nl - 192.168.10.99 service3.staging.kallestruik.nl - 192.168.10.99 service4.staging.kallestruik.nl - 192.168.10.99 service5.staging.kallestruik.nl - 192.168.10.99 service6.staging.kallestruik.nl - ''; - services.udev.packages = [ # Allow flashing android devices and using ADB pkgs.android-udev-rules ]; + # ROCm support + hardware.graphics.extraPackages = with pkgs; [ + rocmPackages.clr.icd + ]; + # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It's perfectly fine and recommended to leave diff --git a/modules/bash.nix b/modules/_base/bash.nix similarity index 63% rename from modules/bash.nix rename to modules/_base/bash.nix index 521f085..a3a6190 100644 --- a/modules/bash.nix +++ b/modules/_base/bash.nix @@ -7,11 +7,6 @@ programs.bash = { enable = true; shellAliases = { - # Git aliases - gg = "git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an (%ae)%C(reset)' --all"; - gca = "git add -A; git commit -a --amend --no-edit"; - gs = "git status"; - # Replace some commands with better versions diff = "${pkgs.difftastic}/bin/difft"; }; @@ -19,6 +14,12 @@ function open() { xdg-open $@ &> /dev/null & } + + # Fzf for command history + if command -v fzf-share >/dev/null; then + source "$(fzf-share)/key-bindings.bash" + source "$(fzf-share)/completion.bash" + fi ''; }; @@ -34,5 +35,9 @@ package.disabled = true; }; }; + + home.packages = with pkgs; [ + fzf + ]; }; } diff --git a/modules/_base/default.nix b/modules/_base/default.nix new file mode 100644 index 0000000..c9dbd49 --- /dev/null +++ b/modules/_base/default.nix @@ -0,0 +1,19 @@ +{ + pkgs, + ... +}: +{ + imports = [ + ./monitor.nix + ./bash.nix + ./kitty.nix + ./nvim + ./kdeglobals.nix + ./menus + ./zoxide.nix + ]; + + home-manager.users.kalle.home.packages = with pkgs; [ + htop + ]; +} diff --git a/modules/_base/kdeglobals.nix b/modules/_base/kdeglobals.nix new file mode 100644 index 0000000..82ab177 --- /dev/null +++ b/modules/_base/kdeglobals.nix @@ -0,0 +1,32 @@ +{ + config, + lib, + ... +}: +{ + + options.kdeglobals = lib.mkOption { + type = lib.types.nullOr lib.types.attrs; + default = null; + description = '' + Uses `lib.generators.toINI` to generate a kde configuration file that + is symlinked to `kdeglobals` inside the XDG configuration home. Do NOT + enable this module and set this when your system is running Plasma, this + can cause issues including inability to boot the DE properly. + + Configuring this can be useful when running KDE applications or the + Breeze theme outside of Plasma because some of their features rely on + settings defined in this file (e.g. custom coloring in Breeze partially + relies on values defined here, applications like Dolphin read the + default terminal from this file). + ''; + }; + + config = { + home-manager.users.kalle.xdg.configFile = { + ${if config.kdeglobals != null then "kdeglobals" else null}.text = + lib.generators.toINI { } + config.kdeglobals; + }; + }; +} diff --git a/modules/kitty.nix b/modules/_base/kitty.nix similarity index 74% rename from modules/kitty.nix rename to modules/_base/kitty.nix index 9a34f1e..50e57c9 100644 --- a/modules/kitty.nix +++ b/modules/_base/kitty.nix @@ -11,4 +11,10 @@ enable_audio_bell = false; }; }; + + kdeglobals = { + General = { + TerminalApplication = "kitty"; + }; + }; } diff --git a/modules/_base/menus/default.nix b/modules/_base/menus/default.nix new file mode 100644 index 0000000..35b0512 --- /dev/null +++ b/modules/_base/menus/default.nix @@ -0,0 +1,5 @@ +{ ... }: +{ + home-manager.users.kalle.xdg.configFile."menus/applications.menu".source = + ./plasma-applications.menu; +} diff --git a/modules/_base/menus/plasma-applications.menu b/modules/_base/menus/plasma-applications.menu new file mode 100644 index 0000000..80f3a25 --- /dev/null +++ b/modules/_base/menus/plasma-applications.menu @@ -0,0 +1,417 @@ + + + + +
diff --git a/modules/_base/monitor.nix b/modules/_base/monitor.nix new file mode 100644 index 0000000..f998f64 --- /dev/null +++ b/modules/_base/monitor.nix @@ -0,0 +1,74 @@ +{ + config, + lib, + ... +}: +{ + options = + let + inherit (lib) mkOption types; + mkStrOption = + default: + mkOption { + type = types.str; + default = default; + }; + mkIntOption = + default: + mkOption { + type = types.int; + default = default; + }; + mkBoolOption = + default: + mkOption { + type = types.bool; + default = default; + }; + in + { + monitors = mkOption { + type = types.listOf ( + types.submodule { + options = { + isPrimary = mkBoolOption false; + name = mkStrOption null; + width = mkIntOption 1920; + height = mkIntOption 1080; + refreshRate = mkIntOption 60; + x = mkIntOption 0; + y = mkIntOption 0; + transform = mkOption { + type = types.enum [ + "normal" + "clockwise" + "flip" + "counterclockwise" + ]; + default = "normal"; + }; + vrr = mkBoolOption false; + }; + } + ); + default = [ ]; + }; + }; + config = + let + monitors = config.monitors; + primaryMonitor = lib.findSingle (m: m.isPrimary) "none" "multiple" monitors; + in + { + assertions = [ + { + assertion = primaryMonitor != "none"; + message = "No primary monitor"; + } + { + assertion = primaryMonitor != "multiple"; + message = "Multiple primary monitors"; + } + ]; + }; +} diff --git a/modules/nvim/default.nix b/modules/_base/nvim/default.nix similarity index 100% rename from modules/nvim/default.nix rename to modules/_base/nvim/default.nix diff --git a/modules/nvim/keymaps.lua b/modules/_base/nvim/keymaps.lua similarity index 100% rename from modules/nvim/keymaps.lua rename to modules/_base/nvim/keymaps.lua diff --git a/modules/nvim/options.lua b/modules/_base/nvim/options.lua similarity index 100% rename from modules/nvim/options.lua rename to modules/_base/nvim/options.lua diff --git a/modules/nvim/plugin/cmp.lua b/modules/_base/nvim/plugin/cmp.lua similarity index 100% rename from modules/nvim/plugin/cmp.lua rename to modules/_base/nvim/plugin/cmp.lua diff --git a/modules/nvim/plugin/lsp.lua b/modules/_base/nvim/plugin/lsp.lua similarity index 98% rename from modules/nvim/plugin/lsp.lua rename to modules/_base/nvim/plugin/lsp.lua index 03d2a35..1b5f30d 100644 --- a/modules/nvim/plugin/lsp.lua +++ b/modules/_base/nvim/plugin/lsp.lua @@ -152,9 +152,7 @@ require('rust-tools').setup({ on_attach = on_attach, settings = { ["rust-analyzer"] = { - checkOnSave = { - command = "clippy" - }, + checkOnSave = true, }, } }, diff --git a/modules/nvim/plugin/telescope.lua b/modules/_base/nvim/plugin/telescope.lua similarity index 100% rename from modules/nvim/plugin/telescope.lua rename to modules/_base/nvim/plugin/telescope.lua diff --git a/modules/nvim/plugin/treesitter.lua b/modules/_base/nvim/plugin/treesitter.lua similarity index 100% rename from modules/nvim/plugin/treesitter.lua rename to modules/_base/nvim/plugin/treesitter.lua diff --git a/modules/_base/zoxide.nix b/modules/_base/zoxide.nix new file mode 100644 index 0000000..8b8a564 --- /dev/null +++ b/modules/_base/zoxide.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + home-manager.users.kalle.programs.zoxide.enable = true; +} diff --git a/modules/ags/config/package.json b/modules/ags/config/package.json deleted file mode 100644 index c03d968..0000000 --- a/modules/ags/config/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "astal-shell", - "dependencies": { - "astal": "/nix/store/hd98qfcisszjr5prmb9dz0wd7fq74ffn-astal-gjs/share/astal/gjs" - } -} diff --git a/modules/ags/config/widget/Bar.tsx b/modules/ags/config/widget/Bar.tsx deleted file mode 100644 index 2cbd442..0000000 --- a/modules/ags/config/widget/Bar.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { App, Astal, Gtk, Gdk } from "astal/gtk3" -import { Variable } from "astal" - -const time = Variable("").poll(1000, "date") - -export default function Bar(gdkmonitor: Gdk.Monitor) { - const { TOP, LEFT, RIGHT } = Astal.WindowAnchor - - return