diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/by-name/lf/lf/colors (renamed from modules/home.legacy/conf/lf/colors) | 0 | ||||
-rw-r--r-- | modules/by-name/lf/lf/commands/default.nix (renamed from modules/home.legacy/conf/lf/commands/default.nix) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/archive.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/archive.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/broot_jump.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/broot_jump.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/chmod.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/chmod.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/clear_trash.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/clear_trash.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/cow_cp.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/cow_cp.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/dl_file.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/dl_file.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/dragon.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/dragon.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/dragon_individual.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/dragon_individual.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/dragon_stay.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/dragon_stay.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/execute.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/execute.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/follow_link.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/follow_link.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/fzf_jump.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/fzf_jump.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/go_project_root.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/go_project_root.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/mk_dir.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/mk_dir.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/mk_file.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/mk_file.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/mk_file_and_edit.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/mk_ln.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/mk_ln.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/mk_scr_default.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/mk_scr_temp.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/restore_trash.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/restore_trash.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/set_wall_paper.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/stripspace.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/stripspace.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/trash.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/trash.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/unarchive.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/unarchive.sh) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/commands/scripts/view_file.sh (renamed from modules/home.legacy/conf/lf/commands/scripts/view_file.sh) | 0 | ||||
-rw-r--r-- | modules/by-name/lf/lf/icons (renamed from modules/home.legacy/conf/lf/icons) | 0 | ||||
-rw-r--r-- | modules/by-name/lf/lf/keybindings/default.nix (renamed from modules/home.legacy/conf/lf/keybindings/default.nix) | 4 | ||||
-rw-r--r-- | modules/by-name/lf/lf/module.nix | 87 | ||||
-rw-r--r-- | modules/by-name/lf/lf/secrets/cd_paths.age (renamed from modules/by-name/se/secrets/lf/cd_paths.age) | 0 | ||||
-rwxr-xr-x | modules/by-name/lf/lf/secrets/update_secret.sh (renamed from modules/by-name/se/secrets/update_secrets.sh) | 18 | ||||
-rw-r--r-- | modules/by-name/te/tempfiles/module.nix | 20 | ||||
-rw-r--r-- | modules/home.legacy/conf/lf/default.nix | 59 |
34 files changed, 95 insertions, 93 deletions
diff --git a/modules/home.legacy/conf/lf/colors b/modules/by-name/lf/lf/colors index 1c2853ec..1c2853ec 100644 --- a/modules/home.legacy/conf/lf/colors +++ b/modules/by-name/lf/lf/colors diff --git a/modules/home.legacy/conf/lf/commands/default.nix b/modules/by-name/lf/lf/commands/default.nix index 933769ac..933769ac 100644 --- a/modules/home.legacy/conf/lf/commands/default.nix +++ b/modules/by-name/lf/lf/commands/default.nix diff --git a/modules/home.legacy/conf/lf/commands/scripts/archive.sh b/modules/by-name/lf/lf/commands/scripts/archive.sh index 25f40534..25f40534 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/archive.sh +++ b/modules/by-name/lf/lf/commands/scripts/archive.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/broot_jump.sh b/modules/by-name/lf/lf/commands/scripts/broot_jump.sh index 8f40ba01..8f40ba01 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/broot_jump.sh +++ b/modules/by-name/lf/lf/commands/scripts/broot_jump.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/chmod.sh b/modules/by-name/lf/lf/commands/scripts/chmod.sh index 9859127b..9859127b 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/chmod.sh +++ b/modules/by-name/lf/lf/commands/scripts/chmod.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/clear_trash.sh b/modules/by-name/lf/lf/commands/scripts/clear_trash.sh index 9052bb5f..9052bb5f 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/clear_trash.sh +++ b/modules/by-name/lf/lf/commands/scripts/clear_trash.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/cow_cp.sh b/modules/by-name/lf/lf/commands/scripts/cow_cp.sh index 98675b9e..98675b9e 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/cow_cp.sh +++ b/modules/by-name/lf/lf/commands/scripts/cow_cp.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/dl_file.sh b/modules/by-name/lf/lf/commands/scripts/dl_file.sh index c7e3d8b2..c7e3d8b2 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/dl_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/dl_file.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/dragon.sh b/modules/by-name/lf/lf/commands/scripts/dragon.sh index cf3c3176..cf3c3176 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/dragon.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/dragon_individual.sh b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh index 2465cdfa..2465cdfa 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/dragon_individual.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_individual.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/dragon_stay.sh b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh index 066b4c75..066b4c75 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/dragon_stay.sh +++ b/modules/by-name/lf/lf/commands/scripts/dragon_stay.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/execute.sh b/modules/by-name/lf/lf/commands/scripts/execute.sh index aa97fd7f..aa97fd7f 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/execute.sh +++ b/modules/by-name/lf/lf/commands/scripts/execute.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/follow_link.sh b/modules/by-name/lf/lf/commands/scripts/follow_link.sh index 80413990..80413990 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/follow_link.sh +++ b/modules/by-name/lf/lf/commands/scripts/follow_link.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/fzf_jump.sh b/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh index ad1633fb..ad1633fb 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/fzf_jump.sh +++ b/modules/by-name/lf/lf/commands/scripts/fzf_jump.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/go_project_root.sh b/modules/by-name/lf/lf/commands/scripts/go_project_root.sh index 5f7746d3..5f7746d3 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/go_project_root.sh +++ b/modules/by-name/lf/lf/commands/scripts/go_project_root.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/mk_dir.sh b/modules/by-name/lf/lf/commands/scripts/mk_dir.sh index 150f7eed..150f7eed 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/mk_dir.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_dir.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/mk_file.sh b/modules/by-name/lf/lf/commands/scripts/mk_file.sh index 41d5cf1a..41d5cf1a 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/mk_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_file.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/mk_file_and_edit.sh b/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh index 19fc51db..19fc51db 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/mk_file_and_edit.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_file_and_edit.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/mk_ln.sh b/modules/by-name/lf/lf/commands/scripts/mk_ln.sh index 7fab8e22..7fab8e22 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/mk_ln.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_ln.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/mk_scr_default.sh b/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh index 47d05080..47d05080 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/mk_scr_default.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_scr_default.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/mk_scr_temp.sh b/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh index 512b5d0b..512b5d0b 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/mk_scr_temp.sh +++ b/modules/by-name/lf/lf/commands/scripts/mk_scr_temp.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/restore_trash.sh b/modules/by-name/lf/lf/commands/scripts/restore_trash.sh index b4ef492f..b4ef492f 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/restore_trash.sh +++ b/modules/by-name/lf/lf/commands/scripts/restore_trash.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/set_wall_paper.sh b/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh index 2e607d33..2e607d33 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/set_wall_paper.sh +++ b/modules/by-name/lf/lf/commands/scripts/set_wall_paper.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/stripspace.sh b/modules/by-name/lf/lf/commands/scripts/stripspace.sh index 33b1cbcf..33b1cbcf 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/stripspace.sh +++ b/modules/by-name/lf/lf/commands/scripts/stripspace.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/trash.sh b/modules/by-name/lf/lf/commands/scripts/trash.sh index f4878c49..f4878c49 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/trash.sh +++ b/modules/by-name/lf/lf/commands/scripts/trash.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/unarchive.sh b/modules/by-name/lf/lf/commands/scripts/unarchive.sh index d4835f6b..d4835f6b 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/unarchive.sh +++ b/modules/by-name/lf/lf/commands/scripts/unarchive.sh diff --git a/modules/home.legacy/conf/lf/commands/scripts/view_file.sh b/modules/by-name/lf/lf/commands/scripts/view_file.sh index 6258d755..6258d755 100755 --- a/modules/home.legacy/conf/lf/commands/scripts/view_file.sh +++ b/modules/by-name/lf/lf/commands/scripts/view_file.sh diff --git a/modules/home.legacy/conf/lf/icons b/modules/by-name/lf/lf/icons index 9047fbfb..9047fbfb 100644 --- a/modules/home.legacy/conf/lf/icons +++ b/modules/by-name/lf/lf/icons diff --git a/modules/home.legacy/conf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index b41004dc..b6feffe3 100644 --- a/modules/home.legacy/conf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -1,4 +1,4 @@ -{nixosConfig, ...}: { +{uid}: { # Remove some defaults "'\"'" = null; ";" = null; @@ -81,7 +81,7 @@ # Movement gjr = "cd ~/.local/share/Trash/files"; - gus = "cd /run/user/${builtins.toString nixosConfig.users.users.soispha.uid}"; + gus = "cd /run/user/${builtins.toString uid}"; gc = "cd ~/.config"; gl = "cd ~/.local"; diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix new file mode 100644 index 00000000..ad4173c3 --- /dev/null +++ b/modules/by-name/lf/lf/module.nix @@ -0,0 +1,87 @@ +{ + pkgs, + config, + sysLib, + shell_library, + system, + lib, + ... +}: let + commands = import ./commands {inherit pkgs sysLib shell_library system;}; + keybindings = import ./keybindings {inherit (cfg.keymaps) uid;}; + + cfg = config.soispha.programs.lf; +in { + options.soispha.programs.lf = { + enable = lib.mkEnableOption "lf"; + keymaps.uid = lib.mkOption { + description = '' + The uid to use when constructing the `/run/user/''${uid}` path. + ''; + type = lib.types.ints.unsigned; + default = config.users.users.soispha.uid; + }; + }; + + config = lib.mkIf cfg.enable { + systemd.tmpfiles.rules = [ + # This file is needed to trash stuff on the root ('/') temp file system. + "d /.Trash 1777 root root" + ]; + + age.secrets.lf_cd_paths = { + file = ./secrets/cd_paths.age; + mode = "700"; + owner = "soispha"; + group = "users"; + }; + + home-manager.users.soispha = { + xdg.configFile."lf/icons".source = ./icons; + xdg.configFile."lf/colors".source = ./colors; + + programs.lf = { + enable = true; + + inherit commands keybindings; + + previewer = { + keybinding = "i"; + source = "${pkgs.ctpv}/bin/ctpv"; + }; + settings = { + # close the server, after the last client exits + autoquit = true; + + # disable the cusor in the preview pane + cursorpreviewfmt = ""; + + # preview for directories + # dirpreviews = true; + + # count things in directories + dircounts = true; + + drawbox = true; + + # errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m"; + errorfmt = "\\033[1;91m%s\\033[0m"; + hidden = true; # show hidden files + icons = true; + ifs = "\\n"; # internal field separator for shell commands + #info = "size"; # show the size of a directory + shell = "sh"; + shellopts = "-eu"; # e: exit on error; u: error for unset variables + }; + # TODO: remove auto quit, if it has been added + extraConfig = '' + &${pkgs.ctpv}/bin/ctpv -s $id + cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id + set cleaner ${pkgs.ctpv}/bin/ctpvclear + + source ${config.age.secrets.lf_cd_paths.path} + ''; + }; + }; + }; +} diff --git a/modules/by-name/se/secrets/lf/cd_paths.age b/modules/by-name/lf/lf/secrets/cd_paths.age index 3b018fb7..3b018fb7 100644 --- a/modules/by-name/se/secrets/lf/cd_paths.age +++ b/modules/by-name/lf/lf/secrets/cd_paths.age diff --git a/modules/by-name/se/secrets/update_secrets.sh b/modules/by-name/lf/lf/secrets/update_secret.sh index f1c27d77..b29fdb86 100755 --- a/modules/by-name/se/secrets/update_secrets.sh +++ b/modules/by-name/lf/lf/secrets/update_secret.sh @@ -7,31 +7,25 @@ cleanup() { } trap cleanup EXIT +root="$(git rev-parse --show-toplevel)" +output_file="$(dirname "$0")/cd_paths.age" + update_lf_cd_paths() { echo "Starting to update the lf/cd_paths.age file.." - cd "$(git rev-parse --show-toplevel)/modules/system/secrets" || { - echo "A secrets dir does not exist! (This is most likely a bug)" - exit 1 - } - key_file="$(mktemp)" - nix eval -f ./secrets.nix --json | jq --raw-output '.["lf/cd_paths.age"].publicKeys | join("\n")' >"$key_file" + nix eval -f "$root/secrets.nix" --json | jq --raw-output '.["modules/by-name/lf/lf/secrets/cd_paths.age"].publicKeys | join("\n")' >"$key_file" # `lf-make-map` is provided by the dev shell { lf-make-map --quiet --depth 4 visualize ~/media ~/repos ~/school | sed 's|\(.*\)|# \1|' lf-make-map --quiet --depth 4 generate ~/media ~/repos ~/school - } | age --recipients-file "$key_file" --encrypt --armor --output ./lf/cd_paths.age + } | age --recipients-file "$key_file" --encrypt --armor --output "$output_file" echo "Finished updating the lf/cd_paths.age file.." } -main() { - update_lf_cd_paths -} - -main +update_lf_cd_paths # vim: ft=sh diff --git a/modules/by-name/te/tempfiles/module.nix b/modules/by-name/te/tempfiles/module.nix deleted file mode 100644 index f8bfd4dc..00000000 --- a/modules/by-name/te/tempfiles/module.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - config, - lib, - ... -}: let - cfg = config.soispha.tempfiles; -in { - options.soispha.tempfiles = { - enable = lib.mkEnableOption "systemd tempfiles generation"; - }; - - config = lib.mkIf cfg.enable { - systemd.tmpfiles.rules = [ - # TODO: Find a way to move this file to the lf home manager config. - # - # This file is needed to trash stuff on the root ('/') temp file system. - "d /.Trash 1777 root root" - ]; - }; -} diff --git a/modules/home.legacy/conf/lf/default.nix b/modules/home.legacy/conf/lf/default.nix deleted file mode 100644 index 7b604ed0..00000000 --- a/modules/home.legacy/conf/lf/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ - pkgs, - sysLib, - nixosConfig, - shell_library, - system, - ... -}: let - commands = import ./commands {inherit pkgs sysLib shell_library system;}; - keybindings = import ./keybindings {inherit nixosConfig;}; -in { - xdg.configFile."lf/icons".source = ./icons; - xdg.configFile."lf/colors".source = ./colors; - - # TODO: add the systemd tempfile option here - - programs.lf = { - enable = true; - - inherit commands keybindings; - - previewer = { - keybinding = "i"; - source = "${pkgs.ctpv}/bin/ctpv"; - }; - settings = { - # close the server, after the last client exits - autoquit = true; - - # disable the cusor in the preview pane - cursorpreviewfmt = ""; - - # preview for directories - # dirpreviews = true; - - # count things in directories - dircounts = true; - - drawbox = true; - - # errorfmt = "\\033[1;91m==> ERROR:\\033[0m\\033[1;93m%s\\033[0m"; - errorfmt = "\\033[1;91m%s\\033[0m"; - hidden = true; # show hidden files - icons = true; - ifs = "\\n"; # internal field separator for shell commands - #info = "size"; # show the size of a directory - shell = "sh"; - shellopts = "-eu"; # e: exit on error; u: error for unset variables - }; - # TODO: remove auto quit, if it has been added - extraConfig = '' - &${pkgs.ctpv}/bin/ctpv -s $id - cmd on-quit %${pkgs.ctpv}/bin/ctpv -e $id - set cleaner ${pkgs.ctpv}/bin/ctpvclear - - source ${nixosConfig.age.secrets.lf_cd_paths.path} - ''; - }; -} |