From 197d4362dd9464368f877bbb5b0d9acbaa1a819d Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:24:19 +0200 Subject: [PATCH 1/5] removed autorandr again, see my i3.nix --- flake.nix | 2 +- hosts/vali/mars/i3.nix | 7 + hosts/vali/mars/programs.nix | 1 + modules/other/autorandr.nix | 370 ----------------------------------- 4 files changed, 9 insertions(+), 371 deletions(-) delete mode 100644 modules/other/autorandr.nix diff --git a/flake.nix b/flake.nix index 1995b4e..df11d3f 100644 --- a/flake.nix +++ b/flake.nix @@ -20,7 +20,7 @@ nur = { url = "github:nix-community/NUR"; - inputs.nixpkgs.follows = "nixpkgs"; + #inputs.nixpkgs.follows = "nixpkgs"; }; agenix.url = "github:ryantm/agenix"; diff --git a/hosts/vali/mars/i3.nix b/hosts/vali/mars/i3.nix index 6da1180..3dc1dcb 100644 --- a/hosts/vali/mars/i3.nix +++ b/hosts/vali/mars/i3.nix @@ -14,6 +14,13 @@ in { displayManager = { gdm.enable = true; defaultSession = "none+i3"; + setupCommands = '' + LEFT='DP-2' + CENTER='HDMI-1' + RIGHT='HDMI-0' + ${pkgs.xorg.xrandr}/bin/xrandr --output $CENTER --rotate left --output $LEFT --rotate left --left-of $CENTER --output $RIGHT --right-of $CENTER + ''; +# ❯ xrandr --output HDMI-1 --rotate normal --output DP-2 --rotate normal --left-of HDMI-1 --output HDMI-0 --right-of HDMI-1 }; }; }; diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 44dfaab..9f820a9 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -62,6 +62,7 @@ in { tree unzip ventoy-full + vesktop vlc xclip yt-dlp diff --git a/modules/other/autorandr.nix b/modules/other/autorandr.nix deleted file mode 100644 index f9b4d7c..0000000 --- a/modules/other/autorandr.nix +++ /dev/null @@ -1,370 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.services.autorandr; - hookType = types.lines; - - matrixOf = n: m: elemType: - mkOptionType rec { - name = "matrixOf"; - description = - "${toString n}×${toString m} matrix of ${elemType.description}s"; - check = xss: - let listOfSize = l: xs: isList xs && length xs == l; - in listOfSize n xss - && all (xs: listOfSize m xs && all elemType.check xs) xss; - merge = mergeOneOption; - getSubOptions = prefix: elemType.getSubOptions (prefix ++ [ "*" "*" ]); - getSubModules = elemType.getSubModules; - substSubModules = mod: matrixOf n m (elemType.substSubModules mod); - functor = (defaultFunctor name) // { wrapped = elemType; }; - }; - - profileModule = types.submodule { - options = { - fingerprint = mkOption { - type = types.attrsOf types.str; - description = lib.mdDoc '' - Output name to EDID mapping. - Use `autorandr --fingerprint` to get current setup values. - ''; - default = { }; - }; - - config = mkOption { - type = types.attrsOf configModule; - description = lib.mdDoc "Per output profile configuration."; - default = { }; - }; - - hooks = mkOption { - type = hooksModule; - description = lib.mdDoc "Profile hook scripts."; - default = { }; - }; - }; - }; - - configModule = types.submodule { - options = { - enable = mkOption { - type = types.bool; - description = lib.mdDoc "Whether to enable the output."; - default = true; - }; - - crtc = mkOption { - type = types.nullOr types.ints.unsigned; - description = lib.mdDoc "Output video display controller."; - default = null; - example = 0; - }; - - primary = mkOption { - type = types.bool; - description = lib.mdDoc "Whether output should be marked as primary"; - default = false; - }; - - position = mkOption { - type = types.str; - description = lib.mdDoc "Output position"; - default = ""; - example = "5760x0"; - }; - - mode = mkOption { - type = types.str; - description = lib.mdDoc "Output resolution."; - default = ""; - example = "3840x2160"; - }; - - rate = mkOption { - type = types.str; - description = lib.mdDoc "Output framerate."; - default = ""; - example = "60.00"; - }; - - gamma = mkOption { - type = types.str; - description = lib.mdDoc "Output gamma configuration."; - default = ""; - example = "1.0:0.909:0.833"; - }; - - rotate = mkOption { - type = types.nullOr (types.enum [ "normal" "left" "right" "inverted" ]); - description = lib.mdDoc "Output rotate configuration."; - default = null; - example = "left"; - }; - - transform = mkOption { - type = types.nullOr (matrixOf 3 3 types.float); - default = null; - example = literalExpression '' - [ - [ 0.6 0.0 0.0 ] - [ 0.0 0.6 0.0 ] - [ 0.0 0.0 1.0 ] - ] - ''; - description = lib.mdDoc '' - Refer to - {manpage}`xrandr(1)` - for the documentation of the transform matrix. - ''; - }; - - dpi = mkOption { - type = types.nullOr types.ints.positive; - description = lib.mdDoc "Output DPI configuration."; - default = null; - example = 96; - }; - - scale = mkOption { - type = types.nullOr (types.submodule { - options = { - method = mkOption { - type = types.enum [ "factor" "pixel" ]; - description = lib.mdDoc "Output scaling method."; - default = "factor"; - example = "pixel"; - }; - - x = mkOption { - type = types.either types.float types.ints.positive; - description = lib.mdDoc "Horizontal scaling factor/pixels."; - }; - - y = mkOption { - type = types.either types.float types.ints.positive; - description = lib.mdDoc "Vertical scaling factor/pixels."; - }; - }; - }); - description = lib.mdDoc '' - Output scale configuration. - - Either configure by pixels or a scaling factor. When using pixel method the - {manpage}`xrandr(1)` - option - `--scale-from` - will be used; when using factor method the option - `--scale` - will be used. - - This option is a shortcut version of the transform option and they are mutually - exclusive. - ''; - default = null; - example = literalExpression '' - { - x = 1.25; - y = 1.25; - } - ''; - }; - }; - }; - - hooksModule = types.submodule { - options = { - postswitch = mkOption { - type = types.attrsOf hookType; - description = lib.mdDoc "Postswitch hook executed after mode switch."; - default = { }; - }; - - preswitch = mkOption { - type = types.attrsOf hookType; - description = lib.mdDoc "Preswitch hook executed before mode switch."; - default = { }; - }; - - predetect = mkOption { - type = types.attrsOf hookType; - description = lib.mdDoc '' - Predetect hook executed before autorandr attempts to run xrandr. - ''; - default = { }; - }; - }; - }; - - hookToFile = folder: name: hook: - nameValuePair "xdg/autorandr/${folder}/${name}" { - source = "${pkgs.writeShellScriptBin "hook" hook}/bin/hook"; - }; - profileToFiles = name: profile: - with profile; - mkMerge ([ - { - "xdg/autorandr/${name}/setup".text = concatStringsSep "\n" - (mapAttrsToList fingerprintToString fingerprint); - "xdg/autorandr/${name}/config".text = - concatStringsSep "\n" (mapAttrsToList configToString profile.config); - } - (mapAttrs' (hookToFile "${name}/postswitch.d") hooks.postswitch) - (mapAttrs' (hookToFile "${name}/preswitch.d") hooks.preswitch) - (mapAttrs' (hookToFile "${name}/predetect.d") hooks.predetect) - ]); - fingerprintToString = name: edid: "${name} ${edid}"; - configToString = name: config: - if config.enable then - concatStringsSep "\n" ([ "output ${name}" ] - ++ optional (config.position != "") "pos ${config.position}" - ++ optional (config.crtc != null) "crtc ${toString config.crtc}" - ++ optional config.primary "primary" - ++ optional (config.dpi != null) "dpi ${toString config.dpi}" - ++ optional (config.gamma != "") "gamma ${config.gamma}" - ++ optional (config.mode != "") "mode ${config.mode}" - ++ optional (config.rate != "") "rate ${config.rate}" - ++ optional (config.rotate != null) "rotate ${config.rotate}" - ++ optional (config.transform != null) ("transform " - + concatMapStringsSep "," toString (flatten config.transform)) - ++ optional (config.scale != null) - ((if config.scale.method == "factor" then "scale" else "scale-from") - + " ${toString config.scale.x}x${toString config.scale.y}")) - else '' - output ${name} - off - ''; - -in { - - options = { - - services.autorandr = { - enable = mkEnableOption (lib.mdDoc "handling of hotplug and sleep events by autorandr"); - - defaultTarget = mkOption { - default = "default"; - type = types.str; - description = lib.mdDoc '' - Fallback if no monitor layout can be detected. See the docs - (https://github.com/phillipberndt/autorandr/blob/v1.0/README.md#how-to-use) - for further reference. - ''; - }; - - ignoreLid = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Treat outputs as connected even if their lids are closed"; - }; - - matchEdid = mkOption { - default = false; - type = types.bool; - description = lib.mdDoc "Match displays based on edid instead of name"; - }; - - hooks = mkOption { - type = hooksModule; - description = lib.mdDoc "Global hook scripts"; - default = { }; - example = literalExpression '' - { - postswitch = { - "notify-i3" = "''${pkgs.i3}/bin/i3-msg restart"; - "change-background" = readFile ./change-background.sh; - "change-dpi" = ''' - case "$AUTORANDR_CURRENT_PROFILE" in - default) - DPI=120 - ;; - home) - DPI=192 - ;; - work) - DPI=144 - ;; - *) - echo "Unknown profle: $AUTORANDR_CURRENT_PROFILE" - exit 1 - esac - echo "Xft.dpi: $DPI" | ''${pkgs.xorg.xrdb}/bin/xrdb -merge - '''; - }; - } - ''; - }; - profiles = mkOption { - type = types.attrsOf profileModule; - description = lib.mdDoc "Autorandr profiles specification."; - default = { }; - example = literalExpression '' - { - "work" = { - fingerprint = { - eDP1 = ""; - DP1 = ""; - }; - config = { - eDP1.enable = false; - DP1 = { - enable = true; - crtc = 0; - primary = true; - position = "0x0"; - mode = "3840x2160"; - gamma = "1.0:0.909:0.833"; - rate = "60.00"; - rotate = "left"; - }; - }; - hooks.postswitch = readFile ./work-postswitch.sh; - }; - } - ''; - }; - - }; - - }; - - config = mkIf cfg.enable { - - services.udev.packages = [ pkgs.autorandr ]; - - environment = { - systemPackages = [ pkgs.autorandr ]; - etc = mkMerge ([ - (mapAttrs' (hookToFile "postswitch.d") cfg.hooks.postswitch) - (mapAttrs' (hookToFile "preswitch.d") cfg.hooks.preswitch) - (mapAttrs' (hookToFile "predetect.d") cfg.hooks.predetect) - (mkMerge (mapAttrsToList profileToFiles cfg.profiles)) - ]); - }; - - systemd.services.autorandr = { - wantedBy = [ "sleep.target" ]; - description = "Autorandr execution hook"; - after = [ "sleep.target" ]; - - startLimitIntervalSec = 5; - startLimitBurst = 1; - serviceConfig = { - ExecStart = '' - ${pkgs.autorandr}/bin/autorandr \ - --batch \ - --change \ - --default ${cfg.defaultTarget} \ - ${optionalString cfg.ignoreLid "--ignore-lid"} \ - ${optionalString cfg.matchEdid "--match-edid"} - ''; - Type = "oneshot"; - RemainAfterExit = false; - KillMode = "process"; - }; - }; - - }; - - meta.maintainers = with maintainers; [ alexnortung ]; -} From 77c4dfa74216182e314649a6d09325ec602ca6cb Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:45:33 +0200 Subject: [PATCH 2/5] removed hyprland --- flake.lock | 390 ++++++++++++++++++++++++++++++++++- hosts/vali/mars/programs.nix | 7 +- 2 files changed, 389 insertions(+), 8 deletions(-) diff --git a/flake.lock b/flake.lock index bd91b52..1c1e138 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,27 @@ "type": "github" } }, + "anyrun": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1712136515, + "narHash": "sha256-LpjQJYC24S5P5XhJsZX6HqsQT1pohcFzM6N42I6qo/U=", + "owner": "Kirottu", + "repo": "anyrun", + "rev": "be6728884d543665e7bd137bbef62dc1d04a210b", + "type": "github" + }, + "original": { + "owner": "Kirottu", + "repo": "anyrun", + "type": "github" + } + }, "crane": { "inputs": { "nixpkgs": [ @@ -87,6 +108,21 @@ } }, "flake-compat": { + "locked": { + "lastModified": 1688025799, + "narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=", + "owner": "nix-community", + "repo": "flake-compat", + "rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "flake": false, "locked": { "lastModified": 1696426674, @@ -103,6 +139,49 @@ } }, "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "anyrun", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1696343447, + "narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": [ "schizofox", @@ -123,9 +202,9 @@ "type": "github" } }, - "flake-parts_2": { + "flake-parts_4": { "inputs": { - "nixpkgs-lib": "nixpkgs-lib" + "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { "lastModified": 1698882062, @@ -141,6 +220,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "hercules-ci-effects": { "inputs": { "flake-parts": [ @@ -335,6 +432,127 @@ "type": "github" } }, + "hyprlang_2": { + "inputs": { + "nixpkgs": [ + "hyprlock", + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1711250455, + "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlock": { + "inputs": { + "hyprlang": "hyprlang_2", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1712861866, + "narHash": "sha256-7ISUD6Z8FivTw/Db8tGJdiJeqpvJs7CSCwadopb1oro=", + "owner": "hyprwm", + "repo": "hyprlock", + "rev": "6fa65e1172d633e61ed957a49e7cf96010432623", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlock", + "type": "github" + } + }, + "lib-aggregate": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1712491724, + "narHash": "sha256-E5EcBzf/zaR3hD8g1CDtqqwXXebSWtqOvoaR+LDjTME=", + "owner": "nix-community", + "repo": "lib-aggregate", + "rev": "2737d0204685c3274390229a09eb8f7eaa1a9e89", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "lib-aggregate", + "type": "github" + } + }, + "nix-eval-jobs": { + "inputs": { + "flake-parts": "flake-parts_2", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_3", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1705242886, + "narHash": "sha256-TLj334vRwFtSym3m+NnKcNCnKKPNoTC/TDZL40vmOso=", + "owner": "nix-community", + "repo": "nix-eval-jobs", + "rev": "6b03a93296faf174b97546fd573c8b379f523a8d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-eval-jobs", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1693833173, + "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1701208414, + "narHash": "sha256-xrQ0FyhwTZK6BwKhahIkUVZhMNk21IEI1nUcWSONtpo=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "93e39cc1a087d65bcf7a132e75a650c44dd2b734", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, "nixpak": { "inputs": { "flake-parts": [ @@ -378,6 +596,21 @@ } }, "nixpkgs-lib": { + "locked": { + "lastModified": 1712450863, + "narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "3c62b6a12571c9a7f65ab037173ee153d539905f", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { "locked": { "dir": "lib", "lastModified": 1698611440, @@ -395,6 +628,27 @@ "type": "github" } }, + "nixpkgs-wayland": { + "inputs": { + "flake-compat": "flake-compat", + "lib-aggregate": "lib-aggregate", + "nix-eval-jobs": "nix-eval-jobs", + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1712942143, + "narHash": "sha256-pTpvq5EXPD9noOBkmTEa7mkwMpeda8+8u3anmjxhRAI=", + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "rev": "8ed6e0db00db83e5a598afa6cdf32c9b41f083bd", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-wayland", + "type": "github" + } + }, "nixpkgs_2": { "locked": { "lastModified": 1712791164, @@ -411,6 +665,38 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1703134684, + "narHash": "sha256-SQmng1EnBFLzS7WSRyPM9HgmZP2kLJcPAz+Ug/nug6o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d6863cbcbbb80e71cecfc03356db1cda38919523", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1712791164, + "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1712918680, @@ -429,12 +715,16 @@ "root": { "inputs": { "agenix": "agenix", + "anyrun": "anyrun", "fenix": "fenix", "home-manager": "home-manager_2", "hyprland": "hyprland", + "hyprlock": "hyprlock", "nixpkgs": "nixpkgs_2", + "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", - "schizofox": "schizofox" + "schizofox": "schizofox", + "split-monitor-workspaces": "split-monitor-workspaces" } }, "rust-analyzer-src": { @@ -456,8 +746,8 @@ }, "schizofox": { "inputs": { - "flake-compat": "flake-compat", - "flake-parts": "flake-parts", + "flake-compat": "flake-compat_2", + "flake-parts": "flake-parts_3", "home-manager": "home-manager_3", "nixpak": "nixpak", "nixpkgs": [ @@ -482,7 +772,7 @@ "searx-randomizer": { "inputs": { "crane": "crane", - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_4", "nixpkgs": [ "schizofox", "nixpkgs" @@ -502,6 +792,27 @@ "type": "github" } }, + "split-monitor-workspaces": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1712527107, + "narHash": "sha256-stmJqifOWf8oXxKwHvCo3RaVapXSk1n/+Sf9nKNENEA=", + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "rev": "c5696000777f6586aaa255bd0a9b0627d5da911f", + "type": "github" + }, + "original": { + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, @@ -532,6 +843,73 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs-wayland", + "nix-eval-jobs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1702979157, + "narHash": "sha256-RnFBbLbpqtn4AoJGXKevQMCGhra4h6G2MPcuTSZZQ+g=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "2961375283668d867e64129c22af532de8e77734", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "wlroots": { "flake": false, "locked": { diff --git a/hosts/vali/mars/programs.nix b/hosts/vali/mars/programs.nix index 9f820a9..1f84cdd 100644 --- a/hosts/vali/mars/programs.nix +++ b/hosts/vali/mars/programs.nix @@ -14,8 +14,10 @@ in { bibata-cursors chromium dig + easyeffects element-desktop - eza ripgrep + eza + ripgrep fastfetch (fenix.complete.withComponents [ "cargo" @@ -39,6 +41,7 @@ in { neofetch neovim networkmanagerapplet + nextcloud-client pamixer pavucontrol pcmanfm @@ -53,7 +56,7 @@ in { smartmontools st steam - strawberry + strawberry-qt6 telegram-desktop texliveFull thunderbird From 1b7ea9d9b02930b4eeb09eea12fe21d2bf549084 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:58:33 +0200 Subject: [PATCH 3/5] added ssh, removed unnecessary imports in flake.nix --- flake.nix | 11 +---------- hosts/vali/mars/configuration.nix | 1 + modules/services/default.nix | 1 + modules/services/ssh.nix | 16 ++++++++++++++++ options/common/networking.nix | 5 ++++- 5 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 modules/services/ssh.nix diff --git a/flake.nix b/flake.nix index df11d3f..9e0b0ea 100644 --- a/flake.nix +++ b/flake.nix @@ -36,19 +36,10 @@ url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; - - hyprland = { - url = "github:hyprwm/Hyprland"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - hyprlock = { - url = "github:hyprwm/hyprlock"; - inputs.nixpkgs.follows = "nixpkgs"; - }; split-monitor-workspaces = { url = "github:Duckonaut/split-monitor-workspaces"; - inputs.hyprland.follows = "hyprland"; +# inputs.hyprland.follows = "hyprland"; }; }; } diff --git a/hosts/vali/mars/configuration.nix b/hosts/vali/mars/configuration.nix index fa98be9..3f0b0c6 100644 --- a/hosts/vali/mars/configuration.nix +++ b/hosts/vali/mars/configuration.nix @@ -20,6 +20,7 @@ }; programs = { vesktop.enable = true; + ssh.enable = true; btop.enable = true; mpv.enable = true; i3.enable = true; diff --git a/modules/services/default.nix b/modules/services/default.nix index a17ae8a..433a36b 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1,5 +1,6 @@ _: { imports = [ ./pipewire.nix + ./ssh.nix ]; } diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix new file mode 100644 index 0000000..448aeaf --- /dev/null +++ b/modules/services/ssh.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... } +with lib; let + cfg = config.myOptions.programs.ssh; + username = config.myOptions.other.system.username; +in { + options.myOptions.programs.ssh.enable = mkEnableOption "ssh"; + + config = mkIf cfg.enable { + home-manager.users.${username} = { + programs.ssh = { + startAgent = true; + }; + }; + }; + +} diff --git a/options/common/networking.nix b/options/common/networking.nix index 9023909..b1601cd 100644 --- a/options/common/networking.nix +++ b/options/common/networking.nix @@ -10,7 +10,10 @@ networking = { }; services.resolved = { enable = true; - fallbackDns = ["9.9.9.9"]; + fallbackDns = [ + "9.9.9.9" + "2620::fe::fe" + ]; }; users.users.${username}.extraGroups = [ "networkmanager" ]; } From c95e279029577df86b3d0687286bf946c79319b5 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 20:59:27 +0200 Subject: [PATCH 4/5] fixed ssh AGAIN --- modules/services/ssh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index 448aeaf..64aaf5d 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... } +{ config, lib, pkgs, ... }: with lib; let cfg = config.myOptions.programs.ssh; username = config.myOptions.other.system.username; From 7832bfa08be4b96ea64bc93ce4d0cad0b2ae9173 Mon Sep 17 00:00:00 2001 From: vali Date: Fri, 12 Apr 2024 21:01:02 +0200 Subject: [PATCH 5/5] fixed ssh --- flake.lock | 153 +++++++++++++-------------------------- modules/services/ssh.nix | 2 - 2 files changed, 49 insertions(+), 106 deletions(-) diff --git a/flake.lock b/flake.lock index 1c1e138..4eb23a1 100644 --- a/flake.lock +++ b/flake.lock @@ -222,7 +222,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_5" + "systems": "systems_2" }, "locked": { "lastModified": 1710146030, @@ -330,14 +330,17 @@ "hyprcursor": { "inputs": { "hyprlang": [ + "split-monitor-workspaces", "hyprland", "hyprlang" ], "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] @@ -361,19 +364,17 @@ "hyprcursor": "hyprcursor", "hyprland-protocols": "hyprland-protocols", "hyprlang": "hyprlang", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_2", + "nixpkgs": "nixpkgs_5", + "systems": "systems_3", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1712877538, - "narHash": "sha256-FK4Rhq9mEf8wpS3/K/ueB5Sql2XOeCQX/SzCe/QySNk=", + "lastModified": 1712947921, + "narHash": "sha256-tDnNWtr4y22Qoyneg0TKcIncaeZ/5v1V90gPrLIQd3A=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "b1a94302897ae559c877471f7d365651bcd24ad4", + "rev": "dd6fdf49d9deebfe792ab5cd0332432249922fa9", "type": "github" }, "original": { @@ -385,10 +386,12 @@ "hyprland-protocols": { "inputs": { "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] @@ -410,10 +413,12 @@ "hyprlang": { "inputs": { "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] @@ -432,50 +437,6 @@ "type": "github" } }, - "hyprlang_2": { - "inputs": { - "nixpkgs": [ - "hyprlock", - "nixpkgs" - ], - "systems": "systems_3" - }, - "locked": { - "lastModified": 1711250455, - "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprlock": { - "inputs": { - "hyprlang": "hyprlang_2", - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_4" - }, - "locked": { - "lastModified": 1712861866, - "narHash": "sha256-7ISUD6Z8FivTw/Db8tGJdiJeqpvJs7CSCwadopb1oro=", - "owner": "hyprwm", - "repo": "hyprlock", - "rev": "6fa65e1172d633e61ed957a49e7cf96010432623", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlock", - "type": "github" - } - }, "lib-aggregate": { "inputs": { "flake-utils": "flake-utils", @@ -697,6 +658,22 @@ "type": "github" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1712918680, @@ -718,8 +695,6 @@ "anyrun": "anyrun", "fenix": "fenix", "home-manager": "home-manager_2", - "hyprland": "hyprland", - "hyprlock": "hyprlock", "nixpkgs": "nixpkgs_2", "nixpkgs-wayland": "nixpkgs-wayland", "nur": "nur", @@ -794,9 +769,7 @@ }, "split-monitor-workspaces": { "inputs": { - "hyprland": [ - "hyprland" - ], + "hyprland": "hyprland", "nix-filter": "nix-filter" }, "locked": { @@ -830,16 +803,16 @@ }, "systems_2": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -858,36 +831,6 @@ "type": "github" } }, - "systems_4": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt-nix": { "inputs": { "nixpkgs": [ @@ -913,37 +856,39 @@ "wlroots": { "flake": false, "locked": { - "host": "gitlab.freedesktop.org", - "lastModified": 1709983277, - "narHash": "sha256-wXWIJLd4F2JZeMaihWVDW/yYXCLEC8OpeNJZg9a9ly8=", - "owner": "wlroots", - "repo": "wlroots", - "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", - "type": "gitlab" + "lastModified": 1712935342, + "narHash": "sha256-zzIbTFNFd/as42jyGx23fil2uBDYYv+8GA5JmRq5y9c=", + "owner": "hyprwm", + "repo": "wlroots-hyprland", + "rev": "62eeffbe233d199f520a5755c344e85f8eab7940", + "type": "github" }, "original": { - "host": "gitlab.freedesktop.org", - "owner": "wlroots", - "repo": "wlroots", - "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", - "type": "gitlab" + "owner": "hyprwm", + "repo": "wlroots-hyprland", + "rev": "62eeffbe233d199f520a5755c344e85f8eab7940", + "type": "github" } }, "xdph": { "inputs": { "hyprland-protocols": [ + "split-monitor-workspaces", "hyprland", "hyprland-protocols" ], "hyprlang": [ + "split-monitor-workspaces", "hyprland", "hyprlang" ], "nixpkgs": [ + "split-monitor-workspaces", "hyprland", "nixpkgs" ], "systems": [ + "split-monitor-workspaces", "hyprland", "systems" ] diff --git a/modules/services/ssh.nix b/modules/services/ssh.nix index 64aaf5d..621a741 100644 --- a/modules/services/ssh.nix +++ b/modules/services/ssh.nix @@ -6,11 +6,9 @@ in { options.myOptions.programs.ssh.enable = mkEnableOption "ssh"; config = mkIf cfg.enable { - home-manager.users.${username} = { programs.ssh = { startAgent = true; }; - }; }; }