From 2bd1e6b78524c109da9406253bf10f1754052c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Gro=C3=9Fmann?= Date: Sat, 4 Feb 2023 15:40:33 +0100 Subject: [PATCH] feat: Added both AStA autorandr configs WIP: Started Polybar config --- configuration.nix | 8 ------ flake.lock | 41 ++++++++++++++++++++++++------- flake.nix | 2 +- test.lol | 1 - users/common/autorandr.nix | 28 ++++++++++++++------- users/common/default.nix | 3 +++ users/common/polybar.nix | 50 ++++++++++++++++++++++++++++++++++++++ users/patrick.nix | 1 + 8 files changed, 106 insertions(+), 28 deletions(-) delete mode 100644 test.lol create mode 100644 users/common/polybar.nix diff --git a/configuration.nix b/configuration.nix index bfd7d60..f67ffce 100644 --- a/configuration.nix +++ b/configuration.nix @@ -39,9 +39,6 @@ file = ./secrets/iwd/devolo-og.psk.age; path = "/etc/iwd/devolo-og.psk"; }; - rekey.secrets.test = { - file = ./secrets/test.age; - }; networking.useNetworkd = true; networking.dhcpcd.enable = false; @@ -87,7 +84,6 @@ }; services.autorandr.enable = true; - #TODO sollte nur bestimmte packages sein nicht alle nixpkgs.config.allowUnfree = true; powerManagement.powertop.enable = true; @@ -197,10 +193,6 @@ ]; cores = 0; max-jobs = "auto"; - - # If the yubikey is needed for rekeying my secrets the sandbox need acces to the pcscd daemon socket - # TODO only give the one derivation access to this path - extra-sandbox-paths = lib.mkIf (lib.elem pkgs.age-plugin-yubikey config.rekey.plugins) ["/run/pcscd/"]; }; daemonCPUSchedPolicy = "batch"; daemonIOSchedPriority = 5; diff --git a/flake.lock b/flake.lock index 379abce..9af2e3a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,16 +2,17 @@ "nodes": { "agenix": { "inputs": { + "darwin": "darwin", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1673301561, - "narHash": "sha256-gRUWHbBAtMuPDJQXotoI8u6+3DGBIUZHkyQWpIv7WpM=", + "lastModified": 1675176355, + "narHash": "sha256-Qjxh5cmN56siY97mzmBLI1+cdjXSPqmfPVsKxBvHmwI=", "owner": "ryantm", "repo": "agenix", - "rev": "42d371d861a227149dc9a7e03350c9ab8b8ddd68", + "rev": "b7ffcfe77f817d9ee992640ba1f270718d197f28", "type": "github" }, "original": { @@ -20,6 +21,28 @@ "type": "github" } }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673295039, + "narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "87b9d090ad39b25b2400029c64825fc2a8868943", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1667395993, @@ -43,11 +66,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1674771519, - "narHash": "sha256-U0W3S1nX6yEvLh3Vq70EORbmXecAKXfmEfCfaA4A+I8=", + "lastModified": 1675462931, + "narHash": "sha256-JiOUSERBtA1lN/s9YTKGZoZ3XUicHDwr+C8swaPSh3M=", "owner": "nix-community", "repo": "home-manager", - "rev": "bb4b25b302dbf0f527f190461b080b5262871756", + "rev": "e2c1756e3ae001ca8696912016dd31cb1503ccf3", "type": "github" }, "original": { @@ -58,11 +81,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1674641431, - "narHash": "sha256-qfo19qVZBP4qn5M5gXc/h1MDgAtPA5VxJm9s8RUAkVk=", + "lastModified": 1675362331, + "narHash": "sha256-VmcnKPj5gJLxWK7Bxlhg2LoQvhKRss7Ax+uoFjd3qKY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b97ad7b4330aacda9b2343396eb3df8a853b4fc", + "rev": "a100acd7bbf105915b0004427802286c37738fef", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7f95fca..910451e 100644 --- a/flake.nix +++ b/flake.nix @@ -34,7 +34,7 @@ home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; } - agenix.nixosModule + agenix.nixosModules.default { nix.registry = { nixpkgs.flake = nixpkgs; diff --git a/test.lol b/test.lol deleted file mode 100644 index 54b05df..0000000 --- a/test.lol +++ /dev/null @@ -1 +0,0 @@ -cetiscienrst gnrs ciet diff --git a/users/common/autorandr.nix b/users/common/autorandr.nix index 818d7e0..7911eae 100644 --- a/users/common/autorandr.nix +++ b/users/common/autorandr.nix @@ -5,18 +5,14 @@ }: { programs.autorandr = let dpi_hd = 96; - dpi_uhd = 192; + dpi_uhd = 216; set_dpi = dpi: "echo 'Xft.dpi: ${toString dpi}' | ${pkgs.xorg.xrdb}/bin/xrdb -merge"; eDP-1 = "00ffffffffffff0006afeb3000000000251b0104a5221378020925a5564f9b270c50540000000101010101010101010101010101010152d000a0f0703e803020350058c11000001852d000a0f07095843020350025a51000001800000000000000000000000000000000000000000002001430ff123caa8f0e29aa202020003e"; - in { - enable = true; - profiles.AStA = { + # AStA config as function as we want to enable it for two different setups + asta_conf = {DP-1-1, DP-1-2}: + { fingerprint = { - inherit eDP-1; - # AStA linker arbeitsplatz linker Monitor - DP-1-1 = "00ffffffffffff000472ed0688687101111e010380351e782aa135a35b4fa327115054b30c00714f818081c081009500b300d1c001012a4480a070382740082098040f282100001a023a801871382d40582c45000f282100001e000000fd00304b1e5512000a202020202020000000fc00423234375920430a202020202001cf020327f14b9002030411121300001f01230907078301000065030c001000681a00000101304be6023a801871382d40582c45000f282100001e8c0ad08a20e02d10103e96000f2821000018011d007251d01e206e2855000f282100001e8c0ad090204031200c4055000f282100001800000000000000000000000000000000d0"; - # AStA linker arbeitsplatz rechter Monitor - DP-1-2 = "00ffffffffffff000472ed0682687101111e010380351e782aa135a35b4fa327115054b30c00714f818081c081009500b300d1c001012a4480a070382740082098040f282100001a023a801871382d40582c45000f282100001e000000fd00304b1e5512000a202020202020000000fc00423234375920430a202020202001d5020327f14b9002030411121300001f01230907078301000065030c001000681a00000101304be6023a801871382d40582c45000f282100001e8c0ad08a20e02d10103e96000f2821000018011d007251d01e206e2855000f282100001e8c0ad090204031200c4055000f282100001800000000000000000000000000000000d0"; + inherit eDP-1 DP-1-1 DP-1-2; }; config = { eDP-1 = { @@ -43,6 +39,20 @@ }; hooks.postswitch = set_dpi dpi_hd; }; + in { + enable = true; + profiles.AStA_links = asta_conf { + # AStA linker arbeitsplatz linker Monitor + DP-1-1 = "00ffffffffffff000472ed0688687101111e010380351e782aa135a35b4fa327115054b30c00714f818081c081009500b300d1c001012a4480a070382740082098040f282100001a023a801871382d40582c45000f282100001e000000fd00304b1e5512000a202020202020000000fc00423234375920430a202020202001cf020327f14b9002030411121300001f01230907078301000065030c001000681a00000101304be6023a801871382d40582c45000f282100001e8c0ad08a20e02d10103e96000f2821000018011d007251d01e206e2855000f282100001e8c0ad090204031200c4055000f282100001800000000000000000000000000000000d0"; + # AStA linker arbeitsplatz rechter Monitor + DP-1-2 = "00ffffffffffff000472ed0682687101111e010380351e782aa135a35b4fa327115054b30c00714f818081c081009500b300d1c001012a4480a070382740082098040f282100001a023a801871382d40582c45000f282100001e000000fd00304b1e5512000a202020202020000000fc00423234375920430a202020202001d5020327f14b9002030411121300001f01230907078301000065030c001000681a00000101304be6023a801871382d40582c45000f282100001e8c0ad08a20e02d10103e96000f2821000018011d007251d01e206e2855000f282100001e8c0ad090204031200c4055000f282100001800000000000000000000000000000000d0"; + }; + profiles.AStA_rechts = asta_conf{ + # AStA rechter arbeitsplatz linker Monitor + DP-1-1 = "00ffffffffffff000472ed068d687101111e010380351e782aa135a35b4fa327115054b30c00714f818081c081009500b300d1c001012a4480a070382740082098040f282100001a023a801871382d40582c45000f282100001e000000fd00304b1e5512000a202020202020000000fc00423234375920430a202020202001ca020327f14b9002030411121300001f01230907078301000065030c001000681a00000101304be6023a801871382d40582c45000f282100001e8c0ad08a20e02d10103e96000f2821000018011d007251d01e206e2855000f282100001e8c0ad090204031200c4055000f282100001800000000000000000000000000000000d0"; + # AStA rechter arbeitsplatz rechter Monitor + DP-1-2 = "00ffffffffffff000472ed0680687101111e010380351e782aa135a35b4fa327115054b30c00714f818081c081009500b300d1c001012a4480a070382740082098040f282100001a023a801871382d40582c45000f282100001e000000fd00304b1e5512000a202020202020000000fc00423234375920430a202020202001d7020327f14b9002030411121300001f01230907078301000065030c001000681a00000101304be6023a801871382d40582c45000f282100001e8c0ad08a20e02d10103e96000f2821000018011d007251d01e206e2855000f282100001e8c0ad090204031200c4055000f282100001800000000000000000000000000000000d0"; + }; profiles.laptop = { fingerprint = { inherit eDP-1; diff --git a/users/common/default.nix b/users/common/default.nix index 5239532..5b8d368 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -66,6 +66,9 @@ "localhost" = { inherit identityFile; }; + "gitlab.lrz.de" = { + inherit identityFile; + }; "*" = { identitiesOnly = true; }; diff --git a/users/common/polybar.nix b/users/common/polybar.nix new file mode 100644 index 0000000..55e84ad --- /dev/null +++ b/users/common/polybar.nix @@ -0,0 +1,50 @@ +{ + config, + ... +}: +let + color = { + bground = ; + fground = ; +in +{ + services.polybar = { + enable = true; + settings = { + "bar/main" = { + monitor = "DP-1"; + monitro.fallback = "eDP-1"; + bottom = true; + + dpi = 96; + heigh = 22; + + background = color.bground; + foreground = color.fground; + + font = { + 0 = "FiraCode Nerd Font Mono:style=Medium:size=13"; + 1 = ""; + 2 = "Iosevka Nerd Font:style=Medium:size=16"; + 3 = "Font Awesome 5 Pro:style=Solid:size=13"; + 4 = "Font Awesome 5 Pro:style=Regular:size=13"; + 5 = "Font Awesome 5 Pro:style=Light:size=13"; + }; + + modules = { + left = [ "icon" "left1" "title" "left2" ]; + center = [ "workspaces" ]; + right = [ "right5" "alsa" "right4" "battery" "right3" "network" "date" "right1" "keyboardswitcher" ]; + }; + + tray = { + position = "right"; + background = color.shade1; + }; + + enable.ipc = true; + + + }; + }; +} diff --git a/users/patrick.nix b/users/patrick.nix index f0c3980..9a8a848 100644 --- a/users/patrick.nix +++ b/users/patrick.nix @@ -8,6 +8,7 @@ common/herbstluftwm.nix common/autorandr.nix common/desktop.nix + # common/polybar.nix ./common ];