Compare commits

...

3 Commits

Author SHA1 Message Date
0e90938280 Refactor a bit 2026-02-22 00:14:18 +01:00
15da1edc1e Define modules
This makes things a bit more robust against moving around files.
2026-02-22 00:04:35 +01:00
f652d2388f Use uwsm for running hyprland 2026-02-21 23:42:35 +01:00
8 changed files with 93 additions and 54 deletions

View File

@ -27,44 +27,60 @@
outputs = outputs =
{ {
self,
darwin, darwin,
nixpkgs, nixpkgs,
home-manager, home-manager,
nix-rosetta-builder, nix-rosetta-builder,
... ...
}@inputs: }@inputs:
let
sharedArgs = { inherit inputs self; };
in
{ {
darwinConfigurations = { nixosModules = {
larstvei-macbookpro = darwin.lib.darwinSystem { base = ./modules/base;
system = "aarch64-darwin"; nixos = ./modules/nixos;
graphical = ./modules/nixos/graphical;
};
specialArgs = { inherit inputs; }; homeModules = {
full = ./modules/home/full;
desktop = ./modules/desktop;
minimal = ./modules/home/minimal;
};
modules = [ darwinModules = {
home-manager.darwinModules.default base = ./modules/darwin;
./machines/macbook };
nix-rosetta-builder.darwinModules.default
{ nix-rosetta-builder.onDemand = true; } darwinConfigurations.larstvei-macbookpro = darwin.lib.darwinSystem {
]; system = "aarch64-darwin";
specialArgs = sharedArgs;
modules = [
home-manager.darwinModules.default
./machines/macbook
nix-rosetta-builder.darwinModules.default
{ nix-rosetta-builder.onDemand = true; }
];
};
nixosConfigurations =
let
mkLinux =
system: path:
nixpkgs.lib.nixosSystem {
system = system;
specialArgs = sharedArgs;
modules = [
home-manager.nixosModules.default
path
];
};
in
{
thinkpad = mkLinux "x86_64-linux" ./machines/thinkpad;
vm-aarch64 = mkLinux "aarch64-linux" ./machines/vm-aarch64;
}; };
};
nixosConfigurations.thinkpad = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
home-manager.nixosModules.default
./machines/thinkpad
];
};
nixosConfigurations.vm-aarch64 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = { inherit inputs; };
modules = [
home-manager.nixosModules.default
./machines/vm-aarch64
];
};
}; };
} }

View File

@ -1,8 +1,13 @@
{ pkgs, inputs, ... }: {
self,
pkgs,
inputs,
...
}:
{ {
imports = [ imports = [
../../modules/base self.nixosModules.base
../../modules/darwin self.darwinModules.base
]; ];
system.primaryUser = "larstvei"; system.primaryUser = "larstvei";
@ -18,6 +23,6 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { inherit inputs; }; extraSpecialArgs = { inherit inputs; };
users.larstvei.imports = [ ../../modules/home/full ]; users.larstvei.imports = [ self.homeModules.full ];
}; };
} }

View File

@ -1,15 +1,16 @@
{ self, ... }:
{ {
imports = [ imports = [
./keyboard ./keyboard
./hardware ./hardware
../../modules/base self.nixosModules.base
../../modules/nixos self.nixosModules.nixos
../../modules/nixos/graphical self.nixosModules.graphical
]; ];
home-manager.users.larstvei.imports = [ home-manager.users.larstvei.imports = [
../../modules/home/full self.homeModules.full
../../modules/desktop self.homeModules.desktop
]; ];
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;

View File

@ -1,14 +1,13 @@
{ self, ... }:
{ {
imports = [ imports = [
./hardware ./hardware
../../modules/base self.nixosModules.base
../../modules/nixos self.nixosModules.nixos
# ../../modules/nixos-graphical
]; ];
home-manager.users.larstvei.imports = [ home-manager.users.larstvei.imports = [
../../modules/home/minimal self.homeModules.minimal
# ../../modules/desktop
]; ];
networking.hostName = "larstvei-vm"; networking.hostName = "larstvei-vm";

View File

@ -47,6 +47,10 @@
services.darkman = { services.darkman = {
enable = true; enable = true;
settings.portal = true; settings = {
portal = true;
lat = 59.9;
lng = 10.7;
};
}; };
} }

View File

@ -61,7 +61,7 @@ in
"$mod, code:28, exec, kitty" # T (code:28) "$mod, code:28, exec, kitty" # T (code:28)
"$mod, code:26, exec, emacs" # E (code:26) "$mod, code:26, exec, emacs" # E (code:26)
"$mod, code:56, exec, zen-beta" # B (code:56) "$mod, code:56, exec, zen-beta" # B (code:56)
"$mod, code:40, exec, darkman toggle" # D (code:40) "$mod, code:40, exec, ${pkgs.darkman}/bin/darkman toggle" # D (code:40)
"$mod, code:65, exec, ${nanostatus}/bin/nanostatus-toggle" # Space (code:65) "$mod, code:65, exec, ${nanostatus}/bin/nanostatus-toggle" # Space (code:65)
"$mod SHIFT, code:58, exec, ${toggle-mirror-display}/bin/toggle-mirror-display" # M (code:58) + Shift "$mod SHIFT, code:58, exec, ${toggle-mirror-display}/bin/toggle-mirror-display" # M (code:58) + Shift

View File

@ -1,3 +1,4 @@
{ pkgs, ... }:
let let
theme = import ../theme; theme = import ../theme;
in in
@ -15,7 +16,10 @@ in
settings = { settings = {
exec-once = [ "swaylock || hyprctl dispatch exit" ]; exec-once = [
"uwsm finalize"
"swaylock || hyprctl dispatch exit"
];
misc.disable_hyprland_logo = true; misc.disable_hyprland_logo = true;
@ -61,14 +65,16 @@ in
services.darkman = { services.darkman = {
lightModeScripts.hyprland-light = '' lightModeScripts.hyprland-light = ''
hyprctl keyword misc:background_color 0x${theme.bg.light} while read -r line; do export "$line"; done < <(${pkgs.systemd}/bin/systemctl --user show-environment)
hyprctl keyword general:col.active_border 0xFF${theme.primary.light} ${pkgs.hyprland}/bin/hyprctl keyword misc:background_color 0x${theme.bg.light}
hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.light} ${pkgs.hyprland}/bin/hyprctl keyword general:col.active_border 0xFF${theme.primary.light}
${pkgs.hyprland}/bin/hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.light}
''; '';
darkModeScripts.hyprland-dark = '' darkModeScripts.hyprland-dark = ''
hyprctl keyword misc:background_color 0x${theme.bg.dark} while read -r line; do export "$line"; done < <(${pkgs.systemd}/bin/systemctl --user show-environment)
hyprctl keyword general:col.active_border 0xFF${theme.primary.dark} ${pkgs.hyprland}/bin/hyprctl keyword misc:background_color 0x${theme.bg.dark}
hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.dark} ${pkgs.hyprland}/bin/hyprctl keyword general:col.active_border 0xFF${theme.primary.dark}
${pkgs.hyprland}/bin/hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.dark}
''; '';
}; };
} }

View File

@ -4,7 +4,7 @@
enable = true; enable = true;
settings = rec { settings = rec {
initial_session = { initial_session = {
command = "hyprland > /dev/null 2>&1"; command = "${pkgs.uwsm}/bin/uwsm start hyprland-uwsm.desktop";
user = "larstvei"; user = "larstvei";
}; };
default_session = initial_session; default_session = initial_session;
@ -23,7 +23,15 @@
extraPortals = [ extraPortals = [
pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gtk
pkgs.darkman
]; ];
config.hyprland."org.freedesktop.impl.portal.Settings" = "darkman";
config.hyprland = {
default = [
"hyprland"
"gtk"
];
"org.freedesktop.impl.portal.Settings" = [ "darkman" ];
};
}; };
} }