Compare commits

..

7 Commits

9 changed files with 283 additions and 34 deletions

243
flake.lock generated
View File

@ -18,7 +18,7 @@
},
"flake-utils": {
"inputs": {
"systems": "systems"
"systems": "systems_2"
},
"locked": {
"lastModified": 1705309234,
@ -36,7 +36,7 @@
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
"systems": "systems_3"
},
"locked": {
"lastModified": 1705309234,
@ -73,6 +73,117 @@
"type": "github"
}
},
"home-manager-unstable": {
"inputs": {
"nixpkgs": [
"nixpkgs-unstable"
]
},
"locked": {
"lastModified": 1708294481,
"narHash": "sha256-DZtxmeb4OR7iCaKUUuq05ADV2rX8WReZEF7Tq//W0+Y=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a54e05bc12d88ff2df941d0dc1183cb5235fa438",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"hyprland": {
"inputs": {
"hyprland-protocols": "hyprland-protocols",
"hyprlang": "hyprlang",
"nixpkgs": "nixpkgs",
"systems": "systems",
"wlroots": "wlroots",
"xdph": "xdph"
},
"locked": {
"lastModified": 1708300923,
"narHash": "sha256-TnZ4E2AZbRXcm5tuior9KMNSjruy11Oqic0yc7ySU1U=",
"owner": "hyprwm",
"repo": "Hyprland",
"rev": "69a4f08dbee6dc08d1e2ce498ce80ab20844e4f3",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "Hyprland",
"type": "github"
}
},
"hyprland-protocols": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1691753796,
"narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=",
"owner": "hyprwm",
"repo": "hyprland-protocols",
"rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprland-protocols",
"type": "github"
}
},
"hyprlang": {
"inputs": {
"nixpkgs": [
"hyprland",
"nixpkgs"
]
},
"locked": {
"lastModified": 1708005943,
"narHash": "sha256-9TT3xk++LI5/SPYgjYX34xZ4ebR93c1uerIq+SE/ues=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "aeb3e012adc7b3235335c540b214b82267c2b983",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprlang_2": {
"inputs": {
"nixpkgs": [
"hyprland",
"xdph",
"nixpkgs"
]
},
"locked": {
"lastModified": 1704287638,
"narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=",
"owner": "hyprwm",
"repo": "hyprlang",
"rev": "6624f2bb66d4d27975766e81f77174adbe58ec97",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprlang",
"type": "github"
}
},
"hyprwm-contrib": {
"inputs": {
"nixpkgs": [
@ -100,11 +211,11 @@
]
},
"locked": {
"lastModified": 1707620986,
"narHash": "sha256-XE0tCSkSVBeJDWhjFwusNInwAhrnp+TloUNUpvnTiLw=",
"lastModified": 1708225687,
"narHash": "sha256-NJBDfvknI26beOFmjO2coeJMTTUCCtw2Iu+rvJ1Zb9k=",
"owner": "nix-community",
"repo": "nix-index-database",
"rev": "0cb4345704123492e6d1f1068629069413c80de0",
"rev": "17352eb241a8d158c4ac523b19d8d2a6c8efe127",
"type": "github"
},
"original": {
@ -122,11 +233,11 @@
]
},
"locked": {
"lastModified": 1707761607,
"narHash": "sha256-OKNdTgnyhZpmqdgba8s78/QvowyTIMJDp0iLxv570bU=",
"lastModified": 1708331102,
"narHash": "sha256-nTOiQvmbB9HtxeTWgXdd2FH2w3cOyOIIrPUm+YtDVyY=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "c8ddba82ca6b791be1acaae4b336ff8e857ec70b",
"rev": "e6bbc01a35626b8db741bcbc0af807379d372218",
"type": "github"
},
"original": {
@ -137,27 +248,27 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1707978831,
"narHash": "sha256-UblFdWQ2MMZNzD9C/w8+7RjAJ2QIbebbzHUniQ/a44o=",
"lastModified": 1707546158,
"narHash": "sha256-nYYJTpzfPMDxI8mzhQsYjIUX+grorqjKEU9Np6Xwy/0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c68a9fc85c2cb3a313be6ff40511635544dde8da",
"rev": "d934204a0f8d9198e1e4515dd6fec76a139c87f0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1708093448,
"narHash": "sha256-gohEm3/NVyu7WINFhRf83yJH8UM2ie/KY9Iw3VN6fiE=",
"lastModified": 1708247094,
"narHash": "sha256-H2VS7VwesetGDtIaaz4AMsRkPoSLEVzL/Ika8gnbUnE=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c7763249f02b7786b4ca36e13a4d7365cfba162f",
"rev": "045b51a3ae66f673ed44b5bbd1f4a341d96703bf",
"type": "github"
},
"original": {
@ -167,6 +278,22 @@
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1708161998,
"narHash": "sha256-6KnemmUorCvlcAvGziFosAVkrlWZGIc6UNT9GUYr0jQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "84d981bae8b5e783b3b548de505b22880559515f",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pkg-android-tools": {
"locked": {
"lastModified": 1676239704,
@ -186,14 +313,16 @@
"root": {
"inputs": {
"home-manager": "home-manager",
"home-manager-unstable": "home-manager-unstable",
"hyprland": "hyprland",
"hyprwm-contrib": "hyprwm-contrib",
"nix-index-database": "nix-index-database",
"nix-wsl": "nix-wsl",
"nixpkgs": "nixpkgs",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"pkg-android-tools": "pkg-android-tools",
"rust-overlay": "rust-overlay",
"systems": "systems_3"
"systems": "systems_4"
}
},
"rust-overlay": {
@ -204,11 +333,11 @@
]
},
"locked": {
"lastModified": 1708135817,
"narHash": "sha256-EUMO/K3+Wgh0THOLoRXhxrh6G/pQ7BlJ8No+ciy1nKA=",
"lastModified": 1708308739,
"narHash": "sha256-FtKWP6d51kz8282jfziNNcCBpAvEzv2TtKH6dYIXCuA=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "c77e68d33a84ce3f9e86905c0f2ef78d5defad28",
"rev": "d45281ce1027a401255db01ea44972afbc569b7e",
"type": "github"
},
"original": {
@ -219,16 +348,16 @@
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"repo": "default-linux",
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"repo": "default-linux",
"type": "github"
}
},
@ -261,6 +390,70 @@
"repo": "default",
"type": "github"
}
},
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"wlroots": {
"flake": false,
"locked": {
"host": "gitlab.freedesktop.org",
"lastModified": 1706359063,
"narHash": "sha256-5HUTG0p+nCJv3cn73AmFHRZdfRV5AD5N43g8xAePSKM=",
"owner": "wlroots",
"repo": "wlroots",
"rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
"type": "gitlab"
},
"original": {
"host": "gitlab.freedesktop.org",
"owner": "wlroots",
"repo": "wlroots",
"rev": "00b869c1a96f300a8f25da95d624524895e0ddf2",
"type": "gitlab"
}
},
"xdph": {
"inputs": {
"hyprland-protocols": [
"hyprland",
"hyprland-protocols"
],
"hyprlang": "hyprlang_2",
"nixpkgs": [
"hyprland",
"nixpkgs"
],
"systems": [
"hyprland",
"systems"
]
},
"locked": {
"lastModified": 1706521509,
"narHash": "sha256-AInZ50acOJ3wzUwGzNr1TmxGTMx+8j6oSTzz4E7Vbp8=",
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"rev": "c06fd88b3da492b8f9067be021b9184f7012b5a8",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
}
},
"root": "root",

View File

@ -14,6 +14,11 @@
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager-unstable = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
# 33.0.3p2 as suggested by https://xdaforums.com/t/guide-january-3-2024-root-pixel-7-pro-unlock-bootloader-pass-safetynet-both-slots-bootable-more.4505353/
# android tools versions [ 34.0.0, 34.0.5 ) causes bootloops somehow and 34.0.5 isn't in nixpkgs yet
pkg-android-tools.url = "github:NixOS/nixpkgs/55070e598e0e03d1d116c49b9eff322ef07c6ac6";
@ -29,6 +34,9 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# no inputs.nixpkgs.follows so i can use cachix
hyprland.url = "github:hyprwm/Hyprland";
hyprwm-contrib = {
url = "github:hyprwm/contrib";
inputs.nixpkgs.follows = "nixpkgs";
@ -80,7 +88,13 @@
# system and configures the given module to the user's Home Manager
# configuration
homeManagerInit = let _username=username;
in {system, username ? _username , module ? _ : {}, rootModule ? (import ./home/root.nix), userModules ? { ${username} = [ module ] ; root = [ rootModule ]; }, stateVersion }:
in { system,
home-manager ? inputs.home-manager,
username ? _username,
module ? _ : {},
rootModule ? (import ./home/root.nix),
userModules ? { ${username} = [ module ] ; root = [ rootModule ]; },
stateVersion }:
{ config, lib, pkgs, ... }:
let
mapUserModules = lib.attrsets.mapAttrs (user: modules: {...}:
@ -96,7 +110,7 @@
in
{
imports = [
inputs.home-manager.nixosModules.home-manager
home-manager.nixosModules.home-manager
];
home-manager = {
@ -112,9 +126,17 @@
# This function produces a nixosSystem which imports configuration.nix and
# a Home Manager home.nix for the given user from ./hosts/${hostname}/
mkSystem = let _username=username; _overlays=overlays;
in {system, overlays ? _overlays, hostname, username ? _username, stateVersion, extraModules ? [] }:
lib.nixosSystem {
mkSystem = let _username=username; _overlays=overlays; _nixpkgs=nixpkgs;
in { system,
nixpkgs ? _nixpkgs,
home-manager ? inputs.home-manager,
overlays ? _overlays,
hostname,
username ? _username,
stateVersion,
extraModules ? [] }:
nixpkgs.lib.nixosSystem {
inherit system;
modules = [
./system
@ -134,6 +156,7 @@
})
./hosts/${hostname}/configuration.nix
(homeManagerInit {
inherit home-manager;
module = import ./hosts/${hostname}/home.nix;
inherit username system stateVersion;
})
@ -176,6 +199,8 @@
nixosConfigurations = {
slab = mkSystem {
nixpkgs = inputs.nixpkgs-unstable;
home-manager = inputs.home-manager-unstable;
system = "x86_64-linux";
hostname = "slab";
stateVersion = "23.11";

View File

@ -60,6 +60,7 @@ in
wayland.windowManager.hyprland = {
enable = true;
package = lib.mkIf (osConfig ? programs) (lib.mkDefault osConfig.programs.hyprland.package);
settings = {
# Xwayland fix

View File

@ -40,6 +40,7 @@
fun.enable = true;
};
sessions.hyprland.enable = true;
sessions.hyprland.useFlake = true;
sessions.plasma.enable = lib.mkDefault false;
programs = {
adb.enable = true;

23
system/cachix.nix Normal file
View File

@ -0,0 +1,23 @@
{ pkgs, lib, config, ... }:
let
cfg = config.nixfiles.cachix;
in
{
options.nixfiles.cachix.enable = lib.mkOption {
description = "Whether to enable the Cachix derivation cache";
type = lib.types.bool;
default = true;
example = false;
};
config = lib.mkIf cfg.enable {
nix.settings = {
substituters = [
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
};
};
}

View File

@ -11,6 +11,7 @@ in
./programs
./sessions
./testing
./cachix.nix
];
config = {};
options.nixfiles = {

View File

@ -8,7 +8,7 @@ let
x86 = [ "i686-linux" "x86_64-linux" ];
windows = [ "x86_64-windows" "i686-windows" ];
systems = {
x86_64-linux = riscv ++ arm ++ windows;
x86_64-linux = riscv ++ arm;
aarch64-linux = riscv;
};
in

View File

@ -45,6 +45,8 @@ in
vulkan-tools
legendary-gl
heroic
protonup-ng
protonup-qt
];
};
}

View File

@ -1,6 +1,7 @@
{ lib, pkgs, config, ... }:
{ lib, pkgs, config, inputs, ... }:
let
cfg = config.nixfiles.sessions.hyprland;
flake-package = inputs.hyprland.packages.${pkgs.system}.hyprland;
in
{
# imports = [
@ -11,6 +12,7 @@ in
options.nixfiles.sessions.hyprland = {
enable = lib.mkEnableOption "hyprland configuration";
useFlake = lib.mkEnableOption "hyprland flake package";
};
config = lib.mkIf cfg.enable {
@ -25,9 +27,10 @@ in
programs.hyprland = {
enable = true;
# TODO base this on if nvidia is enabled
enableNvidiaPatches = lib.mkDefault true;
# # TODO base this on if nvidia is enabled
# enableNvidiaPatches = lib.mkIf (!cfg.useFlake) lib.mkDefault true;
xwayland.enable = true;
package = lib.mkIf cfg.useFlake flake-package;
};
xdg.portal = {