This commit is contained in:
kalle 2025-06-26 17:03:29 +02:00
parent 4a46b96e41
commit 4564e513b9
65 changed files with 1366 additions and 884 deletions

5
README.md Normal file
View file

@ -0,0 +1,5 @@
# Kalle's NixOS Dotfiles
## TODO:
Improve Hyprland module to be less verbose

BIN
assets/login_wallpaper.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 KiB

586
flake.lock generated
View file

@ -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": {

View file

@ -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;
};
}

View file

@ -1,11 +1,17 @@
{
inputs,
pkgs,
hostname,
moduleRel,
...
}:
{
imports = [
imports =
[
inputs.home-manager.nixosModules.home-manager
]
++ moduleRel [
"_base"
];
nix.settings = {
@ -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;

View file

@ -2,44 +2,27 @@
inputs,
config,
pkgs,
moduleRel,
...
}:
{
imports = [
../_base
imports =
[
./hardware-configuration.nix
]
++ moduleRel [
"sddm.nix"
"plasma.nix"
../../modules/sddm.nix
../../modules/plasma.nix
../../modules/bash.nix
../../modules/kitty.nix
../../modules/git.nix
../../modules/direnv.nix
../../modules/firefox.nix
../../modules/nvim
"bash.nix"
"kitty.nix"
"git.nix"
"direnv.nix"
"firefox.nix"
"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
];
};

View file

@ -1,56 +1,70 @@
{
inputs,
config,
pkgs,
moduleRel,
...
}:
{
imports = [
../_base
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"
# Browsers - Yes I need them all
"browsers/firefox.nix"
"browsers/zen-browser.nix"
"browsers/chromium.nix"
# Hardware
"hardware/zsa.nix"
];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
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,47 +75,25 @@
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 = {
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";
"${mod}, Print" = "exec, ${pkgs.bash}/bin/bash -c \"grim -g \\\"$(slurp)\\\" - | wl-copy\"";
", 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
};
@ -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

View file

@ -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
];
};
}

19
modules/_base/default.nix Normal file
View file

@ -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
];
}

View file

@ -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;
};
};
}

View file

@ -11,4 +11,10 @@
enable_audio_bell = false;
};
};
kdeglobals = {
General = {
TerminalApplication = "kitty";
};
};
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
home-manager.users.kalle.xdg.configFile."menus/applications.menu".source =
./plasma-applications.menu;
}

View file

@ -0,0 +1,417 @@
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
<!--
The plasma-applications.menu file is copied directly from
https://github.com/KDE/plasma-workspace/commits/master/menu/desktop/plasma-applications.menu
at hash 11e7f5306fa013ec5c2b894a28457dabf5c42bad
It would certainly be more desirable to just have this file be a
flake-input, but alas, flake inputs do not support sparse repo checkouts,
and I don't wanna pull in half of the Plasma source (100+ MiB) for a single
few KiB file. In any case, even if this file gets outdated compared to the
newer version it is VERY unlikely this would actually break anything
(unless we go from Plasma 6 to 7 or something).
-->
<Menu>
<Name>Applications</Name>
<Directory>kde-main.directory</Directory>
<!-- Search the default locations -->
<DefaultAppDirs/>
<DefaultDirectoryDirs/>
<DefaultLayout>
<Merge type="menus"/>
<Merge type="files"/>
<Separator/>
<Menuname>More</Menuname>
</DefaultLayout>
<Layout>
<Merge type="menus"/>
<Menuname>Applications</Menuname>
<Merge type="files"/>
</Layout>
<Menu>
<Name>Applications</Name>
<Directory>kf5-unknown.directory</Directory>
<OnlyUnallocated/>
<Include>
<Not>
<!-- Don't list non-KDE core applications -->
<And>
<Category>Core</Category>
<Not><Category>KDE</Category></Not>
</And>
<!-- Don't list SUSE's YaST in here -->
<Category>X-SuSE-YaST</Category>
<Category>X-KDE-settings-hardware</Category>
<Category>X-KDE-settings-accessibility</Category>
<Category>X-KDE-settings-components</Category>
<Category>X-KDE-settings-desktop</Category>
<Category>X-KDE-settings-looknfeel</Category>
<Category>X-KDE-settings-network</Category>
<Category>X-KDE-settings-webbrowsing</Category>
<Category>X-KDE-settings-peripherals</Category>
<Category>X-KDE-settings-hardware</Category>
<Category>X-KDE-settings-power</Category>
<Category>X-KDE-settings-security</Category>
<Category>X-KDE-settings-sound</Category>
<Category>X-KDE-settings-system</Category>
<Category>X-KDE-information</Category>
<Filename>kde-kcm_knetworkconfmodule_ss.desktop</Filename>
<Filename>kde-medianotifications.desktop</Filename>
<Filename>kde-audioencoding.desktop</Filename>
</Not>
</Include>
</Menu>
<Menu>
<Name>Development</Name>
<Directory>kf5-development.directory</Directory>
<Menu>
<Name>Translation</Name>
<Directory>kf5-development-translation.directory</Directory>
<Include>
<And>
<Category>Development</Category>
<Category>Translation</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Web Development</Name>
<Directory>kf5-development-webdevelopment.directory</Directory>
<Include>
<And>
<Category>Development</Category>
<Category>WebDevelopment</Category>
</And>
</Include>
</Menu>
<Include>
<And>
<Category>Development</Category>
<Not><Category>Translation</Category></Not>
<Not><Category>WebDevelopment</Category></Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Science</Name>
<Directory>kf5-science.directory</Directory>
<Include>
<And><!-- Include /any/ Science app which is not an Education app -->
<Or>
<Category>Astronomy</Category>
<Category>Biology</Category>
<Category>Chemistry</Category>
<Category>Geology</Category>
<Category>MedicalSoftware</Category>
<Category>Physics</Category>
<Category>Math</Category>
<Category>Science</Category>
</Or>
<Not><Category>Education</Category></Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Education</Name>
<Directory>kf5-education.directory</Directory>
<Menu>
<Name>Languages</Name>
<Directory>kf5-edu-languages.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Languages</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Mathematics</Name>
<Directory>kf5-edu-mathematics.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Math</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Miscellaneous</Name>
<Directory>kf5-edu-miscellaneous.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Not>
<Category>Languages</Category>
<Category>Math</Category>
<Category>Science</Category>
<Category>Teaching</Category>
</Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Science</Name>
<Directory>kf5-edu-science.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Science</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Tools</Name>
<Directory>kf5-edu-tools.directory</Directory>
<Include>
<And>
<Category>Education</Category>
<Category>Teaching</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Games</Name>
<Directory>kf5-games.directory</Directory>
<Menu>
<Name>Arcade</Name>
<Directory>kf5-games-arcade.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>ArcadeGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Board</Name>
<Directory>kf5-games-board.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>BoardGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Card</Name>
<Directory>kf5-games-card.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>CardGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Kidsgames</Name>
<Directory>kf5-games-kids.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>KidsGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>TacticStrategy</Name>
<Directory>kf5-games-strategy.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>StrategyGame</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>Logic</Name>
<Directory>kf5-games-logic.directory</Directory>
<Include>
<And>
<Category>Game</Category>
<Category>LogicGame</Category>
</And>
</Include>
</Menu>
<Include>
<And>
<Category>Game</Category>
<Not>
<Category>ArcadeGame</Category>
<Category>BoardGame</Category>
<Category>CardGame</Category>
<Category>KidsGame</Category>
<Category>StrategyGame</Category>
<Category>LogicGame</Category>
</Not>
</And>
</Include>
</Menu>
<Menu>
<Name>Graphics</Name>
<Directory>kf5-graphics.directory</Directory>
<Include>
<And>
<Category>Graphics</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Graphics</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Internet</Name>
<Directory>kf5-internet.directory</Directory>
<Include>
<And>
<Category>Network</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>Terminal</Name>
<Directory>kf5-internet-terminal.directory</Directory>
</Menu>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Network</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Multimedia</Name>
<Directory>kf5-multimedia.directory</Directory>
<Include>
<And>
<Category>AudioVideo</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>AudioVideo</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Office</Name>
<Directory>kf5-office.directory</Directory>
<Layout>
<Merge type="menus"/>
<Filename>kde-koshell.desktop</Filename>
<Filename>kde-Kontact.desktop</Filename>
<Separator/>
<Filename>kde-kword.desktop</Filename>
<Filename>kde-kspread.desktop</Filename>
<Filename>kde-kpresenter.desktop</Filename>
<Merge type="files"/>
<Separator/>
<Menuname>More</Menuname>
</Layout>
<Include>
<And>
<Category>Office</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Office</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>System</Name>
<Directory>kf5-system.directory</Directory>
<Include>
<Category>Settings</Category>
<And>
<Category>System</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
</Include>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>System</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
<Menu>
<Name>ScreenSavers</Name>
<Directory>kf5-system-screensavers.directory</Directory>
</Menu>
<Menu>
<Name>Terminal</Name>
<Directory>kf5-system-terminal.directory</Directory>
</Menu>
</Menu>
<Menu>
<Name>Utilities</Name>
<Directory>kf5-utilities.directory</Directory>
<Include>
<And>
<Category>Utility</Category>
<Not><Category>X-KDE-More</Category></Not>
</And>
<Category>TextEditor</Category>
<Category>Accessibility</Category>
<Category>X-KDE-Utilities-Desktop</Category>
<Category>X-KDE-Utilities-File</Category>
<Category>X-KDE-Utilities-Peripherals</Category>
<Category>X-KDE-Utilities-PIM</Category>
</Include>
<Menu>
<Name>XUtilities</Name>
<Directory>kf5-utilities-xutils.directory</Directory>
</Menu>
<Menu>
<Name>More</Name>
<Directory>kf5-more.directory</Directory>
<Include>
<And>
<Category>Utility</Category>
<Category>X-KDE-More</Category>
</And>
</Include>
</Menu>
</Menu>
<Menu>
<Name>Help</Name>
<Directory>kf5-help.directory</Directory>
<Include>
<Category>Documentation</Category>
</Include>
</Menu>
<DefaultMergeDirs/>
<MergeFile>applications-kmenuedit.menu</MergeFile>
</Menu>

74
modules/_base/monitor.nix Normal file
View file

@ -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";
}
];
};
}

View file

@ -152,9 +152,7 @@ require('rust-tools').setup({
on_attach = on_attach,
settings = {
["rust-analyzer"] = {
checkOnSave = {
command = "clippy"
},
checkOnSave = true,
},
}
},

4
modules/_base/zoxide.nix Normal file
View file

@ -0,0 +1,4 @@
{ ... }:
{
home-manager.users.kalle.programs.zoxide.enable = true;
}

View file

@ -1,6 +0,0 @@
{
"name": "astal-shell",
"dependencies": {
"astal": "/nix/store/hd98qfcisszjr5prmb9dz0wd7fq74ffn-astal-gjs/share/astal/gjs"
}
}

View file

@ -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 <window
className="Bar"
gdkmonitor={gdkmonitor}
exclusivity={Astal.Exclusivity.EXCLUSIVE}
anchor={TOP | LEFT | RIGHT}
application={App}>
<centerbox>
<box halign={Gtk.Align.START}>
<button
onClicked="echo hello"
>
Welcome to AGS!
</button>
</box>
<box halign={Gtk.Align.CENTER}>
</box>
<box halign={Gtk.Align.END}>
<label label={time()} />
</box>
</centerbox>
</window>
}

View file

@ -0,0 +1,8 @@
{
...
}:
{
home-manager.users.kalle.programs.chromium = {
enable = true;
};
}

View file

@ -0,0 +1,21 @@
{ pkgs, ... }:
{
imports = [
./dolphin.nix
];
home-manager.users.kalle.home.packages =
with pkgs;
[
vlc
feishin
pavucontrol
inkscape
gimp
krita
]
++ (with pkgs.kdePackages; [
kate
gwenview
okular
]);
}

View file

@ -0,0 +1,20 @@
{
pkgs,
...
}:
{
kdeglobals = {
PreviewSettings = {
EnableRemoteFolderThumbnail = false;
MaximumRemoteSize = 52428800;
};
};
home-manager.users.kalle.home.packages = with pkgs.kdePackages; [
dolphin
ark
qtsvg
kio-fuse
kio-extras
];
}

View file

@ -0,0 +1,19 @@
{
pkgs,
...
}:
{
imports = [
./git.nix
./direnv.nix
./fd.nix
./ripgrep.nix
];
home-manager.users.kalle.home.packages = with pkgs; [
httpie
gcc
jq
difftastic
];
}

View file

@ -1,6 +1,4 @@
{
...
}:
{ ... }:
{
home-manager.users.kalle.programs.direnv = {
enable = true;

View file

@ -0,0 +1,14 @@
{ ... }:
{
home-manager.users.kalle.programs.fd = {
enable = true;
extraOptions = [
"--hidden"
];
ignores = [
".git/"
"/nix/store"
".nix-profile"
];
};
}

View file

@ -0,0 +1,21 @@
{
...
}:
{
home-manager.users.kalle = {
programs.git = {
enable = true;
userName = "Kalle Struik";
userEmail = "kalle@kallestruik.nl";
extraConfig = {
init.defaultBranch = "main";
};
};
programs.bash.shellAliases = {
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";
};
};
}

View file

@ -0,0 +1,12 @@
{ ... }:
{
home-manager.users.kalle.programs.ripgrep = {
enable = true;
arguments = [
"--hidden"
"--glob=!.nix-profile/*"
"--glob=!.git/*"
"--glob=!/nix/store/*"
];
};
}

9
modules/discord.nix Normal file
View file

@ -0,0 +1,9 @@
{
pkgs,
...
}:
{
home-manager.users.kalle.home.packages = with pkgs; [
discord
];
}

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./steam.nix
./prismlauncher.nix
];
}

View file

@ -0,0 +1,9 @@
{
pkgs,
...
}:
{
home-manager.users.kalle.home.packages = with pkgs; [
prismlauncher
];
}

View file

@ -1,4 +1,5 @@
{
lib,
pkgs,
...
}:
@ -30,5 +31,4 @@
gamescope
pkgsi686Linux.gperftools # Needed for tf2
];
}

View file

@ -1,14 +0,0 @@
{
...
}:
{
home-manager.users.kalle.programs.git = {
enable = true;
userName = "Kalle Struik";
userEmail = "kalle@kallestruik.nl";
extraConfig = {
init.defaultBranch = "main";
};
};
}

View file

@ -1,10 +0,0 @@
{
inputs,
pkgs,
...
}:
{
home-manager.users.kalle.home.packages = [
inputs.grayjay.packages.${pkgs.system}.grayjay
];
}

11
modules/hardware/zsa.nix Normal file
View file

@ -0,0 +1,11 @@
{
pkgs,
...
}:
{
# Allow flashing ZSA keyboards
hardware.keyboard.zsa.enable = true;
environment.systemPackages = with pkgs; [
keymapp
];
}

View file

@ -0,0 +1 @@
/nix/store/hd98qfcisszjr5prmb9dz0wd7fq74ffn-astal-gjs/share/astal/gjs

View file

@ -0,0 +1,21 @@
{
"name": "astal-shell",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "astal-shell",
"dependencies": {
"astal": "/home/kalle/.local/share/ags"
}
},
"../../../../../.local/share/ags": {
"name": "astal",
"license": "LGPL-2.1"
},
"node_modules/astal": {
"resolved": "../../../../../.local/share/ags",
"link": true
}
}
}

View file

@ -0,0 +1,6 @@
{
"name": "astal-shell",
"dependencies": {
"astal": "/home/kalle/.local/share/ags"
}
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./hyprland.nix
./hyprpaper.nix
./ags
];
}

View file

@ -17,53 +17,6 @@
default = "SUPER";
};
primaryMonitor = mkOption {
type = types.str;
};
monitors = mkOption {
type = types.listOf (
types.submodule {
options = {
name = mkOption {
type = types.str;
};
width = mkOption {
type = types.int;
};
height = mkOption {
type = types.int;
};
refreshRate = mkOption {
type = types.int;
default = 60;
};
x = mkOption {
type = types.int;
default = 0;
};
y = mkOption {
type = types.int;
default = 0;
};
transform = mkOption {
type = types.int;
default = 0;
};
vrr = mkOption {
type = types.int;
default = 0;
};
enabled = mkOption {
type = types.bool;
default = true;
};
};
}
);
default = [ ];
};
autoStart = mkOption {
type = types.listOf types.str;
default = [ ];
@ -95,7 +48,25 @@
config =
let
uwsm = "${pkgs.uwsm}/bin/uwsm";
mkUwsmApp = bin: "${uwsm} app -- ${bin}";
mkUwsmDesktopApp = pkg: name: "${uwsm} app -- ${pkg}/share/applications/${name}.desktop";
cfg = config.hyprland;
monitors = config.monitors;
# There is always exactly one primary monitor as asserted in the monitor module
primaryMonitor = lib.findSingle (m: m.isPrimary) "" "" monitors;
transformToOption =
transform:
if transform == "normal" then
""
else if transform == "clockwise" then
"transform,1"
else if transform == "flip" then
"transform,2"
else if transform == "counterclockwise" then
"transform,3"
else
abort "Invalid transform ${transform}";
in
{
nix.settings = {
@ -110,7 +81,6 @@
programs.hyprland = {
enable = true;
withUWSM = true;
package = inputs.hyprland.packages.x86_64-linux.hyprland;
};
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
@ -139,20 +109,18 @@
let
resolution = "${toString m.width}x${toString m.height}@${toString m.refreshRate}";
position = "${toString m.x}x${toString m.y}";
vrr = if m.vrr != 0 then "vrr,${toString m.vrr}" else "";
transform = if m.transform != 0 then "transform,${toString m.transform}" else "";
vrr = if m.vrr != 0 then "vrr,1," else "";
transform = transformToOption m.transform;
in
"${m.name},${if m.enabled then "${resolution},${position},1,${vrr}${transform}" else "disable"}"
) (cfg.monitors)
"${m.name},${resolution},${position},1,${vrr}${transform}"
) (monitors)
# Automatically detect newly connected monitors
++ [ ",preferred,auto,auto" ];
# TODO: Make these start via UWSM
exec-once = [
"${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.cliphist}/bin/cliphist store"
"${pkgs.ulauncher}/bin/ulauncher --no-window-shadow --hide-window"
# TODO: Replace this with hyprland's polkit agent
"${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1"
(mkUwsmApp "${pkgs.wl-clipboard}/bin/wl-paste --watch ${pkgs.cliphist}/bin/cliphist store")
(mkUwsmApp "${pkgs.ulauncher}/bin/ulauncher --no-window-shadow --hide-window")
(mkUwsmApp "${pkgs.hyprpolkitagent}/libexec/hyprpolkitagent")
] ++ cfg.autoStart;
env = [
@ -227,11 +195,13 @@
let
# Create one work space for each non primary monitor
perMonitorWorkspaces = map (m: "name:${m.name}, monitor:${m.name}") (
lib.filter (m: m.name != cfg.primaryMonitor) cfg.monitors
lib.filter (m: m.name != primaryMonitor.name) monitors
);
# Create 10 work spaces on the primary monitor
primaryMonitorWorkspaces = map (i: "${toString i}, monitor:${cfg.primaryMonitor}") (lib.range 1 10);
primaryMonitorWorkspaces = map (i: "${toString i}, monitor:${primaryMonitor.name}") (
lib.range 1 10
);
in
primaryMonitorWorkspaces ++ perMonitorWorkspaces;
@ -274,6 +244,9 @@
x = ident: values: map (y ident) values;
in
lib.flatten (lib.mapAttrsToList x cfg.windowRules);
# Enable color management protocol
debug.full_cm_proto = true;
};
};
};

View file

@ -22,6 +22,7 @@
let
cfg = config.hyprpaper;
hyprlandCfg = config.hyprland;
monitors = config.monitors;
changeWallpaperScript = pkgs.writeShellScriptBin "change-wallpaper" (
lib.concatStringsSep "\n" (
@ -37,7 +38,7 @@
"${pkgs.hyprland}/bin/hyprctl hyprpaper preload $wallpaper"
"${pkgs.hyprland}/bin/hyprctl hyprpaper wallpaper ${output},$wallpaper"
]
) hyprlandCfg.monitors
) monitors
)
++ [ "${pkgs.hyprland}/bin/hyprctl hyprpaper unload all" ]
)

View file

@ -1,6 +1,55 @@
{
lib,
pkgs,
assetRel,
config,
...
}:
let
accentColor = "#306cf8";
monitors = config.monitors;
themePkg = pkgs.sddm-astronaut.override {
themeConfig = {
Background = "${assetRel "login_wallpaper.jpg"}";
FullBlur = "false";
PartialBlur = "true";
HideVirtualKeyboard = "true";
HideLoginButton = "true";
BlurMax = "170";
Blur = "0.8";
HaveFormBackground = "false";
FormPosition = "right";
HighlightBorderColor = accentColor;
HighlightBackgroundColor = accentColor;
DropdownSelectedBackgroundColor = accentColor;
HoverUserIconColor = accentColor;
HoverPasswordIconColor = accentColor;
HoverSystemButtonsIconsColor = accentColor;
HoverSessionButtonTextColor = accentColor;
HoverVirtualKeyboardButtonTextColor = accentColor;
WarningColor = accentColor;
};
};
in
{
services.displayManager.sddm.enable = true;
services.displayManager.sddm = {
enable = true;
theme = "sddm-astronaut-theme";
# Force the use qt6 based sddm, as the default is still qt5
package = lib.mkForce pkgs.kdePackages.sddm;
extraPackages = [ themePkg ];
};
# Disable all non-primary monitors on the login screen
services.xserver.displayManager.setupCommands = lib.concatStringsSep "\n" (
map (m: "${pkgs.xorg.xrandr}/bin/xrandr --output ${m.name} --off") (
lib.filter (m: !m.isPrimary) monitors
)
);
environment.systemPackages = [
themePkg
];
}

View file

@ -0,0 +1,25 @@
{
pkgs,
...
}:
let
cursorName = "breeze_cursors";
cursorSize = 24;
in
{
home-manager.users.kalle.home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
package = pkgs.kdePackages.breeze;
name = cursorName;
size = cursorSize;
};
home-manager.users.kalle.dconf.settings = {
"org/gnome/desktop/interface" = {
cursor-theme = cursorName;
cursor-size = cursorSize;
};
};
}

View file

@ -0,0 +1,8 @@
{ ... }:
{
imports = [
./gtk.nix
./cursor.nix
./qt.nix
];
}

51
modules/theming/gtk.nix Normal file
View file

@ -0,0 +1,51 @@
{
pkgs,
config,
...
}:
let
# WARNING: Official theme, but archived since Jun 2024.
themePackage = pkgs.catppuccin-gtk.override {
accents = [ "blue" ];
size = "standard";
variant = "mocha";
};
themeName = "catppuccin-mocha-blue-standard";
iconPackage = pkgs.kdePackages.breeze-icons;
iconName = "breeze-dark";
in
{
home-manager.users.kalle.gtk = {
enable = true;
theme = {
package = themePackage;
name = themeName;
};
iconTheme = {
package = iconPackage;
name = iconName;
};
# cursorTheme = {package name size}; defaults to home.pointerCursor vals.
gtk3 = {
extraConfig.gtk-application-prefer-dark-theme = true;
};
gtk4 = {
extraConfig.gtk-application-prefer-dark-theme = true;
};
};
# Some software will only behave with theming if you set this (i.e. adjust
# font color), especially software that has heavy integration with DEs
# normally and GTK4 stuff. Also for Wayland software this may work only if
# the gtk desktop portal is installed.
home-manager.users.kalle.dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
gtk-theme = themeName;
icon-theme = iconName;
};
};
}

248
modules/theming/qt.nix Normal file
View file

@ -0,0 +1,248 @@
{
pkgs,
lib,
config,
...
}:
{
home-manager.users.kalle = {
qt = {
enable = true;
platformTheme.name = "qtct";
};
home.packages = with pkgs.kdePackages; [
# Install both breeze5 and breeze6 since qt5 is still very commonplace.
# Use the qt5 output instead of libsForQt5 to prevent package collisions.
breeze
breeze.qt5
# The HM qt module does not actually seem to ship wayland support by default.
qtwayland # for qt6
pkgs.libsForQt5.qtwayland # for qt5
];
xdg.configFile =
let
toStr = builtins.toString;
toINI = lib.generators.toINI { };
confDir = v: "qt${toStr v}ct";
confFile = v: "${confDir v}/qt${toStr v}ct.conf";
colorsFile = v: "${confDir v}/colors/catppuccin-mocha-blue-breeze.conf";
absColorsFile = v: "${config.home-manager.users.kalle.xdg.configHome}/${colorsFile v}";
sharedConf = {
Appearance = {
custom_palette = "true";
icon_theme = "breeze-dark";
standard_dialogs = "default";
style = "Breeze";
};
Interface = {
activate_item_on_single_click = "1";
buttonbox_layout = "0";
cursor_flash_time = "1000";
dialog_buttons_have_icons = "1";
double_click_interval = "400";
keyboard_scheme = "2";
menus_have_icons = "true";
show_shortcuts_in_context_menus = "true";
toolbutton_style = "4";
underline_shortcut = "1";
wheel_scroll_lines = "3";
};
Troubleshooting = {
force_raster_widgets = "1";
};
};
# qt6 expects slightly different config values from qt5 for color schemes.
# In the case of colorschemes (assuming we aim for a consistent coloring
# between both versions) these differences are only at the end. Not
# entirely sure what changes but I have checked that this is also consist
# with what happens in Breeze and Catppuccin-KDE and as far as I can tell
# the theme is consist between qt5 and qt6 apps, so whatever.
colorsConf = v: {
ColorScheme = {
active_colors =
"#ffcdd6f4, #ff313244, #ff3d3d5e, #ff2f2f48, #ff0c0c12, #ff151520, #ffcdd6f4, #ffcdd6f4, #ffcdd6f4, #ff1e1e2e, #ff181825, #ff09090d, #ff89b4fa, #ff11111b, #ff89b4fa, #ffcba6f7, #ff181825, #ffffffff, #ff1e1e2e, #ffcdd6f4, "
+ "${if v == 5 then "#806c7086" else "#ffa6adc8, #ff89b4fa"}";
disabled_colors =
"#ff6c7086, #ff313244, #ff45475a, #ff313244, #ff11111b, #ff181825, #ff6c7086, #ffcdd6f4, #ff6c7086, #ff1e1e2e, #ff181825, #ff11111b, #ff181825, #ff6c7086, #ffa9bcdb, #ffc7cceb, #ff181825, #ffffffff, #ff1e1e2e, #ffcdd6f4, #806c7086"
+ "${if v == 5 then "" else ", #ff181825"}";
inactive_colors =
"#ffcdd6f4, #ff313244, #ff3d3d5e, #ff2f2f48, #ff0c0c12, #ff151520, #ffcdd6f4, #ffcdd6f4, #ffcdd6f4, #ff1e1e2e, #ff181825, #ff09090d, #ff89b4fa, #ff11111b, #ff89b4fa, #ffcba6f7, #ff181825, #ffffffff, #ff1e1e2e, #ffcdd6f4, #806c7086, "
+ "${if v == 5 then "#806c7086" else "#ffa6adc8, #ff89b4fa"}";
};
};
in
{
"${confFile 5}".text = toINI (
lib.recursiveUpdate sharedConf {
Appearance = {
color_scheme_path = absColorsFile 5;
};
Fonts = {
fixed = "\"Noto Sans,10,-1,5,50,0,0,0,0,0,Regular\"";
general = "\"Noto Sans,10,-1,5,50,0,0,0,0,0,Regular\"";
};
}
);
"${confFile 6}".text = toINI (
lib.recursiveUpdate sharedConf {
Appearance = {
color_scheme_path = absColorsFile 6;
};
Fonts = {
fixed = "\"Noto Sans,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular\"";
general = "\"Noto Sans,10,-1,5,400,0,0,0,0,0,0,0,0,0,0,1,Regular\"";
};
}
);
"${colorsFile 5}".text = toINI (colorsConf 5);
"${colorsFile 6}".text = toINI (colorsConf 6);
};
};
kdeglobals = {
UiSettings = {
# Without setting specifically this key to this value, many config
# values for Breeze both from kdeglobals and the qt colorscheme
# are ignored when running outside of Plasma.
ColorScheme = "*";
};
# The colors used here are the Catppuccin Mocha Blue colors. More specifically,
# I stole them directly from the values the offical Catppuccin-KDE distribution
# sets when you apply that theme inside KDE.
"ColorEffects:Disabled" = {
ChangeSelectionColor = "";
Color = "30, 30, 46";
ColorAmount = "0.3";
ColorEffect = "2";
ContrastAmount = "0.1";
ContrastEffect = "0";
Enable = "";
IntensityAmount = "-1";
IntensityEffect = "0";
};
"ColorEffects:Inactive" = {
ChangeSelectionColor = "true";
Color = "30, 30, 46";
ColorAmount = "0.5";
ColorEffect = "3";
ContrastAmount = "0";
ContrastEffect = "0";
Enable = "true";
IntensityAmount = "0";
IntensityEffect = "0";
};
"Colors:Button" = {
BackgroundAlternate = "137,180,250";
BackgroundNormal = "49, 50, 68";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "166, 173, 200";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "205, 214, 244";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
"Colors:Complementary" = {
BackgroundAlternate = "17, 17, 27";
BackgroundNormal = "24, 24, 37";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "166, 173, 200";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "205, 214, 244";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
"Colors:Header" = {
BackgroundAlternate = "17, 17, 27";
BackgroundNormal = "24, 24, 37";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "166, 173, 200";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "205, 214, 244";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
"Colors:Selection" = {
BackgroundAlternate = "137,180,250";
BackgroundNormal = "137,180,250";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "24, 24, 37";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "17, 17, 27";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
"Colors:Tooltip" = {
BackgroundAlternate = "27,25,35";
BackgroundNormal = "30, 30, 46";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "166, 173, 200";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "205, 214, 244";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
"Colors:View" = {
BackgroundAlternate = "24, 24, 37";
BackgroundNormal = "30, 30, 46";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "166, 173, 200";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "205, 214, 244";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
"Colors:Window" = {
BackgroundAlternate = "17, 17, 27";
BackgroundNormal = "24, 24, 37";
DecorationFocus = "137,180,250";
DecorationHover = "49, 50, 68";
ForegroundActive = "250, 179, 135";
ForegroundInactive = "166, 173, 200";
ForegroundLink = "137,180,250";
ForegroundNegative = "243, 139, 168";
ForegroundNeutral = "249, 226, 175";
ForegroundNormal = "205, 214, 244";
ForegroundPositive = "166, 227, 161";
ForegroundVisited = "203, 166, 247";
};
};
}