Compare commits

...

2 commits

Author SHA1 Message Date
1b71633b9b
feat: use per device monitor configuration 2024-11-29 10:58:20 +01:00
cb0744c298
chore: bump flake 2024-11-29 10:58:06 +01:00
6 changed files with 126 additions and 29 deletions

66
flake.lock generated
View file

@ -50,11 +50,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730190761, "lastModified": 1732742778,
"narHash": "sha256-o5m5WzvY6cGIDupuOvjgNSS8AN6yP2iI9MtUC6q/uos=", "narHash": "sha256-i+Uw8VOHzQe9YdNwKRbzvaPWLE07tYVqUDzSFTXhRgk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "3979285062d6781525cded0f6c4ff92e71376b55", "rev": "341482e2f4d888e3f60cae1c12c3df896e7230d8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -70,11 +70,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1727826117, "lastModified": 1730504689,
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", "rev": "506278e768c2a08bec68eb62932193e341f55c90",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -111,11 +111,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1730016908, "lastModified": 1732793095,
"narHash": "sha256-bFCxJco7d8IgmjfNExNz9knP8wvwbXU4s/d53KOK6U0=", "narHash": "sha256-6TrknJ8CpvSSF4gviQSeD+wyj3siRcMvdBKhOXkEMKU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e83414058edd339148dc142a8437edb9450574c8", "rev": "2f7739d01080feb4549524e8f6927669b61c6ee3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -124,6 +124,35 @@
"type": "github" "type": "github"
} }
}, },
"hyprgraphics": {
"inputs": {
"hyprutils": [
"hyprlock",
"hyprutils"
],
"nixpkgs": [
"hyprlock",
"nixpkgs"
],
"systems": [
"hyprlock",
"systems"
]
},
"locked": {
"lastModified": 1732808127,
"narHash": "sha256-jwqYmLVfvoLPu8UScEzZgdbbiNU3ioYcrsthjEEnGqI=",
"owner": "hyprwm",
"repo": "hyprgraphics",
"rev": "4d927a52be7e15e0846456f2aa1b0ad76b5bf059",
"type": "github"
},
"original": {
"owner": "hyprwm",
"repo": "hyprgraphics",
"type": "github"
}
},
"hyprlang": { "hyprlang": {
"inputs": { "inputs": {
"hyprutils": [ "hyprutils": [
@ -155,6 +184,7 @@
}, },
"hyprlock": { "hyprlock": {
"inputs": { "inputs": {
"hyprgraphics": "hyprgraphics",
"hyprlang": "hyprlang", "hyprlang": "hyprlang",
"hyprutils": "hyprutils", "hyprutils": "hyprutils",
"nixpkgs": [ "nixpkgs": [
@ -163,11 +193,11 @@
"systems": "systems_2" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1730053985, "lastModified": 1732812191,
"narHash": "sha256-jh7PhejwT+XqkkYnpZ6K/Gkqy4tvjN7g/ZBTvlS+Q9Y=", "narHash": "sha256-/gYMXqhjvOcjhaYjzb1iqjpoCDqO5lkkqjG93oMMo60=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprlock", "repo": "hyprlock",
"rev": "edbecc87081756b45bdbea16b63e413473659dcd", "rev": "4667f721be47ff6f5cf2a7ee64513f818fb764a0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -221,11 +251,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1730161780, "lastModified": 1732483221,
"narHash": "sha256-z5ILcmwMtiCoHTXS1KsQWqigO7HJO8sbyK7f7wn9F/E=", "narHash": "sha256-kF6rDeCshoCgmQz+7uiuPdREVFuzhIorGOoPXMalL2U=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "07d15e8990d5d86a631641b4c429bc0a7400cfb8", "rev": "45348ad6fb8ac0e8415f6e5e96efe47dd7f39405",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -253,11 +283,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1729880355, "lastModified": 1732521221,
"narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", "narHash": "sha256-2ThgXBUXAE1oFsVATK1ZX9IjPcS4nKFOAjhPNKuiMn0=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "18536bf04cd71abd345f9579158841376fdd0c5a", "rev": "4633a7c72337ea8fd23a4f2ba3972865e3ec685d",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -6,6 +6,9 @@
osConfig, osConfig,
... ...
}: }:
let
inherit (lib) mapAttrs;
in
lib.mkIf osConfig.programs.sway.enable { lib.mkIf osConfig.programs.sway.enable {
services.swayidle.enable = true; services.swayidle.enable = true;
@ -199,14 +202,12 @@ lib.mkIf osConfig.programs.sway.enable {
}; };
#: }}} #: }}}
#: Output {{{ #: Output {{{
output = { output = mapAttrs (name: value: {
eDP-1 = { scale = toString value.scale;
scale = "2"; pos = "${toString value.posX} ${toString value.posY}";
pos = "0 0"; res = "${toString value.resX}x${toString value.resY}";
res = "3840x2400"; adaptive_sync = "on";
adaptive_sync = "on"; }) osConfig.modules.system.outputs;
};
};
#: }}} #: }}}
}; };
}; };

View file

@ -32,9 +32,23 @@
}; };
modules = { modules = {
system.networking = { system = {
wifi.enable = true; outputs = {
bluetooth.enable = true; "DP-2" = {
resX = 1920;
resY = 1080;
};
"HDMI-A-1" = {
posX = 1920;
resX = 1920;
resY = 1080;
};
};
networking = {
wifi.enable = true;
bluetooth.enable = true;
};
}; };
services = { services = {
@ -81,6 +95,7 @@
firefox.enable = true; firefox.enable = true;
thunderbird.enable = true; thunderbird.enable = true;
sway.enable = true; sway.enable = true;
hyprland.enable = true;
}; };
security.polkit.enable = true; security.polkit.enable = true;

View file

@ -17,6 +17,13 @@
media.enableAll = true; media.enableAll = true;
system = { system = {
outputs = {
eDP-1 = {
resX = 3840;
resY = 2400;
scale = 2.0;
};
};
networking = { networking = {
bluetooth.enable = true; bluetooth.enable = true;
wifi.enable = true; wifi.enable = true;

View file

@ -2,5 +2,6 @@
imports = [ imports = [
./networking ./networking
./roles ./roles
./outputs.nix
]; ];
} }

View file

@ -0,0 +1,43 @@
{ lib, ... }:
let
inherit (lib) mkOption;
inherit (lib.types)
attrsOf
submodule
int
float
str
;
in
{
options.modules.system.outputs = mkOption {
type = attrsOf (
submodule (
{ name, config, ... }:
{
options = {
name = mkOption {
type = str;
default = name;
};
scale = mkOption {
type = float;
default = 1.0;
};
posX = mkOption {
type = int;
default = 0;
};
posY = mkOption {
type = int;
default = 0;
};
resX = mkOption { type = int; };
resY = mkOption { type = int; };
};
}
)
);
default = { };
};
}