framework: add niri flake

This commit is contained in:
Tristan 2025-07-16 16:48:50 +01:00
commit c218bd400e
11 changed files with 286 additions and 154 deletions

282
flake.lock generated
View file

@ -37,11 +37,11 @@
"base16-helix": {
"flake": false,
"locked": {
"lastModified": 1736852337,
"narHash": "sha256-esD42YdgLlEh7koBrSqcT7p2fsMctPAcGl/+2sYJa2o=",
"lastModified": 1748408240,
"narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=",
"owner": "tinted-theming",
"repo": "base16-helix",
"rev": "03860521c40b0b9c04818f2218d9cc9efc21e7a5",
"rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e",
"type": "github"
},
"original": {
@ -94,11 +94,11 @@
"firefox-gnome-theme": {
"flake": false,
"locked": {
"lastModified": 1744642301,
"narHash": "sha256-5A6LL7T0lttn1vrKsNOKUk9V0ittdW0VEqh6AtefxJ4=",
"lastModified": 1748383148,
"narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=",
"owner": "rafaelmardojai",
"repo": "firefox-gnome-theme",
"rev": "59e3de00f01e5adb851d824cf7911bd90c31083a",
"rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf",
"type": "github"
},
"original": {
@ -107,21 +107,6 @@
"type": "github"
}
},
"flake-compat": {
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
@ -172,11 +157,11 @@
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"lastModified": 1749398372,
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569",
"type": "github"
},
"original": {
@ -219,54 +204,6 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"stylix",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"stylix",
"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"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"stylix",
"git-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"
}
},
"gnome-shell": {
"flake": false,
"locked": {
@ -291,33 +228,11 @@
]
},
"locked": {
"lastModified": 1749154018,
"narHash": "sha256-gjN3j7joRvT3a8Zgcylnd4NFsnXeDBumqiu4HmY1RIg=",
"lastModified": 1752544374,
"narHash": "sha256-ReX0NG6nIAEtQQjLqeu1vUU2jjZuMlpymNtb4VQYeus=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "7aae0ee71a17b19708b93b3ed448a1a0952bf111",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-25.05",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1747556831,
"narHash": "sha256-Qb84nbYFFk0DzFeqVoHltS2RodAYY5/HZQKE8WnBDsc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d0bbd221482c2713cccb80220f3c9d16a6e20a33",
"rev": "2e00ed310c218127e02ffcf28ddd4e0f669fde3e",
"type": "github"
},
"original": {
@ -373,6 +288,64 @@
"type": "github"
}
},
"niri-flake": {
"inputs": {
"niri-stable": "niri-stable",
"niri-unstable": "niri-unstable",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable",
"xwayland-satellite-stable": "xwayland-satellite-stable",
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1752659960,
"narHash": "sha256-AP/Gds8b1hhU50prgLjYSv5qpy9D8E6Xre/r/gb3K8M=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "8e3f7bbada0cf637d23de4200c6e1a5a157de9cc",
"type": "github"
},
"original": {
"owner": "sodiboo",
"repo": "niri-flake",
"type": "github"
}
},
"niri-stable": {
"flake": false,
"locked": {
"lastModified": 1748151941,
"narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"ref": "v25.05.1",
"repo": "niri",
"type": "github"
}
},
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1752656275,
"narHash": "sha256-tTRMyGxqHF5IkYcnvHbwCgRBRUBhvRapxtuUfrN/8Ic=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "7b065f8618f63b7cf761ebe05a2cebd556113a6c",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"repo": "niri",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1740695751,
@ -389,13 +362,29 @@
"type": "github"
}
},
"nixpkgs_2": {
"nixpkgs-stable": {
"locked": {
"lastModified": 1750622754,
"narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=",
"lastModified": 1752436162,
"narHash": "sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1",
"rev": "dfcd5b901dbab46c9c6e80b265648481aafb01f8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1752436162,
"narHash": "sha256-Kt1UIPi7kZqkSc5HVj6UY5YLHHEzPBkgpNUByuyxtlw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "dfcd5b901dbab46c9c6e80b265648481aafb01f8",
"type": "github"
},
"original": {
@ -406,11 +395,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1750134718,
"narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=",
"lastModified": 1751984180,
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
"type": "github"
},
"original": {
@ -430,11 +419,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1750512587,
"narHash": "sha256-kZqTQEARUkkKDFhECd0MGU4wXCJcxCdh5WeM/yD6oI4=",
"lastModified": 1752010420,
"narHash": "sha256-fboKrq2WeEC2Y4LaZNiiH2dptUYHtSbYhzE0FTN/u+M=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "b04bcdcbba4aa648903e065ad1907a97d4f7aee9",
"rev": "a11133507a930dfd235324cdf776bdb5e6ddd717",
"type": "github"
},
"original": {
@ -457,11 +446,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1746056780,
"narHash": "sha256-/emueQGaoT4vu0QjU9LDOG5roxRSfdY0K2KkxuzazcM=",
"lastModified": 1751320053,
"narHash": "sha256-3m6RMw0FbbaUUa01PNaMLoO7D99aBClmY5ed9V3vz+0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "d476cd0972dd6242d76374fcc277e6735715c167",
"rev": "cbde1735782f9c2bb2c63d5e05fba171a14a4670",
"type": "github"
},
"original": {
@ -498,6 +487,7 @@
"cosmic-manager": "cosmic-manager",
"home-manager": "home-manager",
"musnix": "musnix",
"niri-flake": "niri-flake",
"nixpkgs": "nixpkgs_2",
"nixvim": "nixvim",
"sops-nix": "sops-nix",
@ -512,11 +502,11 @@
]
},
"locked": {
"lastModified": 1750119275,
"narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=",
"lastModified": 1752544651,
"narHash": "sha256-GllP7cmQu7zLZTs9z0J2gIL42IZHa9CBEXwBY9szT0U=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2",
"rev": "2c8def626f54708a9c38a5861866660395bb3461",
"type": "github"
},
"original": {
@ -532,11 +522,8 @@
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat",
"flake-parts": "flake-parts_3",
"git-hooks": "git-hooks",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
"nixpkgs": [
"nixpkgs"
],
@ -549,11 +536,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1750697672,
"narHash": "sha256-F8z6QXKRZfVKwTj8+Uw920tHGDmiRIOD+BsA6wVGOgY=",
"lastModified": 1752599753,
"narHash": "sha256-8ppgjqbFc/697OXgMntMhk+kAQF4BHBog73oP6Xds8Y=",
"owner": "danth",
"repo": "stylix",
"rev": "438a702dc2a49a48eae380623cdc04fe36ef5422",
"rev": "a35db84c7568c75f3ec665fdcd962cc9c52b6c0a",
"type": "github"
},
"original": {
@ -644,11 +631,11 @@
"tinted-schemes": {
"flake": false,
"locked": {
"lastModified": 1744974599,
"narHash": "sha256-Fg+rdGs5FAgfkYNCs74lnl8vkQmiZVdBsziyPhVqrlY=",
"lastModified": 1750770351,
"narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=",
"owner": "tinted-theming",
"repo": "schemes",
"rev": "28c26a621123ad4ebd5bbfb34ab39421c0144bdd",
"rev": "5a775c6ffd6e6125947b393872cde95867d85a2a",
"type": "github"
},
"original": {
@ -660,11 +647,11 @@
"tinted-tmux": {
"flake": false,
"locked": {
"lastModified": 1745111349,
"narHash": "sha256-udV+nHdpqgkJI9D0mtvvAzbqubt9jdifS/KhTTbJ45w=",
"lastModified": 1751159871,
"narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=",
"owner": "tinted-theming",
"repo": "tinted-tmux",
"rev": "e009f18a01182b63559fb28f1c786eb027c3dee9",
"rev": "bded5e24407cec9d01bd47a317d15b9223a1546c",
"type": "github"
},
"original": {
@ -676,11 +663,11 @@
"tinted-zed": {
"flake": false,
"locked": {
"lastModified": 1725758778,
"narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=",
"lastModified": 1751158968,
"narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=",
"owner": "tinted-theming",
"repo": "base16-zed",
"rev": "122c9e5c0e6f27211361a04fae92df97940eccf9",
"rev": "86a470d94204f7652b906ab0d378e4231a5b3384",
"type": "github"
},
"original": {
@ -711,16 +698,49 @@
"type": "github"
}
},
"xwayland-satellite-stable": {
"flake": false,
"locked": {
"lastModified": 1748488455,
"narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.6",
"repo": "xwayland-satellite",
"type": "github"
}
},
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1752338000,
"narHash": "sha256-Fxlp/yKtynug0jyuauAmvZU2SzHCfwlwWf85j+IvQ0U=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "ba78881a68182ce338041846164cbfed0d70935c",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"type": "github"
}
},
"zen-browser": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1750219862,
"narHash": "sha256-wce+erYDBm6wpLJm6IJh85KYqy/NtdKp6DZQCn4YP1Q=",
"lastModified": 1752293576,
"narHash": "sha256-84tAzrC/kioWRmG0jLt1HWRP/wHON7zjLtXCwWRNI/g=",
"owner": "youwen5",
"repo": "zen-browser-flake",
"rev": "18d6cd2f5a9cd1527d478d4f716e9b9ee6fb6cbb",
"rev": "1a40cdcb093a0025631ef692caa53130f821dd77",
"type": "github"
},
"original": {

View file

@ -29,6 +29,12 @@
home-manager.follows = "home-manager";
};
};
niri-flake = {
url = "github:sodiboo/niri-flake";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = {nixvim, ...} @ inputs: let
@ -36,7 +42,7 @@
pkgs = import inputs.nixpkgs {inherit system;};
user = "tristan";
userFullname = "Tristan Beedell";
auto-login = import ./nixos/programs/auto-login.nix;
# auto-login = import ./nixos/programs/auto-login.nix;
mkConf = import ./lib/mkconf.nix {inherit inputs system user userFullname;};
in {
@ -46,6 +52,7 @@
nixos-modules = [
./hardware/zenix.nix
./nixos/programs/cosmic.nix
./nixos/programs/niri.nix
./nixos/programs/gamer.nix
./nixos/programs/personal.nix
./nixos/services/musnix.nix
@ -65,6 +72,7 @@
./nixos/workstation.nix
./nixos/modules/work.nix
./nixos/programs/cosmic.nix
./nixos/programs/niri.nix
];
home-modules = [
./home/programs/work.nix

View file

@ -51,14 +51,12 @@ in {
};
fileSystems."/mnt/hdd" = {
device = "/dev/disk/by-uuid/50d1b0ee-9eb1-4493-acea-4e5bd4b127c8";
fsType = "ext4";
device = "/dev/disk/by-label/seagate-disk-1";
fsType = "btrfs";
options = ["subvol=@steam" "compress=zstd" "autodefrag"];
};
boot.plymouth.enable = true;
boot.initrd.verbose = false;
boot.consoleLogLevel = 1;
boot.kernelParams = ["quiet" "udev.log_level=3"];
swapDevices = [{device = "/dev/disk/by-label/swap";}];
@ -72,7 +70,8 @@ in {
networking.networkmanager.appendNameservers = ["1.1.1.1" "1.0.0.1"];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = true;
hardware.cpu.x86.msr.enable = true;
networking.hostName = "zenix";

View file

@ -49,10 +49,12 @@ in {
compositor = {
autotile = true;
focus_follows_cursor = true;
focus_follows_cursor_delay = 25;
input_default.acceleration = mkRON "optional" {
profile = mkRON "optional" (mkRON "enum" "Flat");
speed = 0.0;
};
keyboard_config.numlock_state = (mkRON "enum" "BootOn");
};
wallpapers = [

View file

@ -1,7 +0,0 @@
{
programs.cosmic = {
panels.Bar.applets.end = [
"com.system76.CosmicAppletBattery"
];
};
}

View file

@ -0,0 +1,77 @@
{
lib,
pkgs,
config,
...
}: {
programs.fuzzel = {
enable = true;
settings = {
main = {
terminal = lib.getExe config.programs.terminal;
font = lib.mkForce "${config.stylix.fonts.sansSerif.name}:size=24";
};
};
};
services.hyprpaper.enable = true;
systemd.user.services.hyprpaper.Unit.WantedBy = ["niri.service"];
services.mako.enable = true;
programs.niri = {
settings = {
input.keyboard = {
xkb.layout = "us";
xkb.variant = "dvorak";
};
input.mouse = {
accel-profile = "flat";
};
input.focus-follows-mouse = {
enable = true;
};
prefer-no-csd = true;
spawn-at-startup = [
{command = [(lib.getExe pkgs.xwayland-satellite)];}
{command = [(lib.getExe config.services.mako.package)];}
];
binds = with config.lib.niri.actions; {
"Mod+Return".action.spawn = [(lib.getExe config.programs.terminal)];
"Mod+O".action.spawn = [(lib.getExe pkgs.cosmic-files)];
"Mod+D".action.spawn = [(lib.getExe config.programs.fuzzel.package)];
"Mod+MouseBack".action = open-overview;
"Mod+MouseForward".action = close-overview;
"Mod+WheelScrollRight".action = focus-column-right;
"Mod+Ctrl+WheelScrollRight".action = move-column-right;
"Mod+Right".action = focus-column-right;
"Mod+L".action = focus-column-right;
"Mod+Ctrl+L".action = move-column-right;
"Mod+WheelScrollLeft".action = focus-column-left;
"Mod+Ctrl+WheelScrollLeft".action = move-column-left;
"Mod+Left".action = focus-column-left;
"Mod+H".action = focus-column-left;
"Mod+Ctrl+H".action = move-column-left;
"Mod+Home".action = focus-column-first;
"Mod+End".action = focus-column-last;
"Mod+Comma".action = consume-or-expel-window-left;
"Mod+Period".action = consume-or-expel-window-right;
"Mod+Q".action = close-window;
"Mod+WheelScrollDown".action = focus-workspace-down;
"Mod+WheelScrollUp".action = focus-workspace-up;
"Mod+Ctrl+WheelScrollDown".action = move-column-to-workspace-down;
"Mod+Ctrl+WheelScrollUp".action = move-column-to-workspace-up;
"Mod+M".action = maximize-column;
"Mod+G".action = toggle-window-floating;
"Print".action = screenshot;
};
};
};
}

View file

@ -47,5 +47,4 @@
]
'';
services.hyprpaper.enable = lib.mkForce false;
}

View file

@ -8,7 +8,6 @@
}: let
user = config.user;
in {
nix = {
settings = {
experimental-features = ["nix-command" "flakes" "pipe-operators"];
@ -62,7 +61,8 @@ in {
i18n.defaultLocale = lib.mkDefault "en_GB.UTF-8";
services.xserver.xkb = {
layout = lib.mkDefault "gb";
layout = lib.mkDefault "us";
variant = lib.mkDefault "dvorak";
options = "caps:escape";
};
@ -112,5 +112,4 @@ in {
programs.command-not-found.enable = false;
programs.nix-index.enable = true;
programs.nh.enable = true;
}

View file

@ -1,12 +1,9 @@
command: {config, ...}: let
user = config.user;
in {
command: {user, ...}: {
services.greetd = {
enable = true;
settings = {
default_session = {
inherit command;
user = user;
inherit command user;
};
};
};

20
nixos/programs/niri.nix Normal file
View file

@ -0,0 +1,20 @@
{
pkgs,
inputs,
user,
...
}: {
programs.niri = {
enable = true;
};
imports = [
./pipewire.nix
../workstation.nix
inputs.niri-flake.nixosModules.niri
];
home-manager.users.${user}.imports = [
../../home/desktop/niri/.
];
}

View file

@ -55,6 +55,24 @@
useWallpaper = true;
};
};
fonts = {
serif = config.stylix.fonts.sansSerif;
sansSerif = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans";
};
monospace = {
package = pkgs.dejavu_fonts;
name = "DejaVu Sans Mono";
};
emoji = {
package = pkgs.noto-fonts-emoji;
name = "Noto Color Emoji";
};
};
};
qt.enable = true;