Personal Nix flake
nixos home-manager nix
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(just): Just in devShells, commands split in modules

+89 -121
+10
just/home.just
··· 1 + # Runs home-manager switch 2 + switch flake='.#': (_hm 'switch' flake) 3 + 4 + # Runs home-manager build 5 + build flake='.#': (_hm 'build' flake) 6 + 7 + _hm command flake='.#': 8 + home-manager {{ command }} \ 9 + --flake '{{ flake }}' \ 10 + -b backup
+14
just/secrets.just
··· 1 + # Updates secret files, run after adding new keys 2 + update: 3 + #!/usr/bin/env zsh 4 + sops updatekeys secrets/**/* 5 + 6 + # Opens a secrets file for editing 7 + @edit file='secrets/default.yaml': 8 + sops {{ file }} 9 + 10 + # Grabs a host's SSH key and generates the corresponding age key 11 + @get-host-key host: 12 + nix shell nixpkgs#ssh-to-age nixpkgs#openssh \ 13 + --command ssh-keyscan localhost 2>/dev/null \ 14 + | ssh-to-age 2>/dev/null
+7
just/secureboot.just
··· 1 + # Generates the necessary keys in /etc/secureboot 2 + create-keys: 3 + sudo sbctl create-keys 4 + 5 + # Enrolls keys, requires system to be in setup mode 6 + enroll-keys: create-keys 7 + sudo sbctl enroll-keys --microsoft
+16
just/system.just
··· 1 + # Runs nixos-rebuild switch 2 + switch flake='.#' target='localhost': (_rebuild 'switch' flake target) 3 + 4 + # Runs nixos-rebuild build 5 + build flake='.#': (_rebuild 'build' flake) 6 + 7 + # Runs nixos-rebuild boot 8 + boot flake='.#': (_rebuild 'boot' flake) 9 + 10 + # Runs nixos-rebuild test 11 + test flake='.#': (_rebuild 'test' flake) 12 + 13 + _rebuild command flake='.#' target='localhost': 14 + sudo nixos-rebuild {{ command }} \ 15 + --flake '{{ flake }}' \ 16 + {{ if target != 'localhost' { '--target-host {{ target }}' } else { "" } }}
+3
just/theme.just
··· 1 + # Opens the current stylix color scheme in a browser 2 + @inspect-theme: 3 + firefox $(readlink -f /etc/stylix/palette.html)
+19
just/u2f.just
··· 1 + # Enroll security key 2 + enroll: 3 + #!/usr/bin/env bash 4 + mkdir -p ~/.config/Yubico 5 + [ -e ~/.config/Yubico/u2f_keys ] \ 6 + && pamu2fcfg \ 7 + --origin="pam://localhost" \ 8 + --appid="pam://auth" \ 9 + --nouser \ 10 + >> ~/.config/Yubico/u2f_keys \ 11 + || pamu2fcfg \ 12 + --origin="pam://localhost" \ 13 + --appid="pam://auth" \ 14 + > ~/.config/Yubico/u2f_keys 15 + 16 + # Clear enrolled security keys, if any 17 + clear: 18 + [ -e ~/.config/Yubico/u2f_keys ] \ 19 + && rm -f ~/.config/Yubico/u2f_keys
+9
justfile
··· 1 + _default: 2 + just --list 3 + 4 + mod home './just/home.just' 5 + mod secrets './just/secrets.just' 6 + mod secureboot './just/secureboot.just' 7 + mod system './just/system.just' 8 + mod theme './just/theme.just' 9 + mod u2f './just/u2f.just'
-1
nix/home/modules/cli/default.nix
··· 33 33 lazygit.enable = mkDefault true; 34 34 }; 35 35 hishtory.enable = mkDefault false; 36 - just.enable = true; 37 36 nushell.enable = mkDefault true; 38 37 starship.enable = mkDefault true; 39 38 tealdeer.enable = mkDefault true;
-34
nix/home/modules/cli/just/default.nix
··· 1 - { 2 - config, 3 - lib, 4 - pkgs, 5 - ... 6 - }: let 7 - cfg = config.my.modules.cli.just; 8 - in { 9 - options.my.modules.cli.just = { 10 - enable = lib.mkEnableOption "just task runner"; 11 - extraConfig = lib.mkOption { 12 - description = "extra text to append to justfile"; 13 - type = lib.types.lines; 14 - default = ""; 15 - }; 16 - }; 17 - config = lib.mkIf cfg.enable { 18 - home = { 19 - packages = [pkgs.just]; 20 - file.".justfile".text = lib.trim '' 21 - ${import ./justfile.nix} 22 - ${cfg.extraConfig} 23 - ''; 24 - shellAliases = { 25 - "_just" = lib.getExe pkgs.just; 26 - "just" = lib.concatStringsSep " " [ 27 - (lib.getExe pkgs.just) 28 - "--unstable" 29 - "--global-justfile" 30 - ]; 31 - }; 32 - }; 33 - }; 34 - }
-78
nix/home/modules/cli/just/justfile.nix
··· 1 - # just 2 - '' 3 - _default: 4 - just --list 5 - 6 - # Runs nixos-rebuild switch 7 - [group("nixos")] 8 - deploy flake='.#' target='localhost': 9 - sudo nixos-rebuild switch \ 10 - --flake {{ flake }} \ 11 - {{ if target != 'localhost' { '--target-host {{ target }}' } else { "" } }} 12 - 13 - # Runs nixos-rebuild test 14 - [group("nixos")] 15 - test flake='.#': 16 - sudo nixos-rebuild test \ 17 - --flake {{ flake }} 18 - 19 - # Updates secret files, run after adding new keys 20 - [group("secrets")] 21 - [group("security")] 22 - update-secrets: 23 - #!/usr/bin/env zsh 24 - sops updatekeys secrets/**/* 25 - 26 - # Grabs a host's SSH key and generates the corresponding age key 27 - [group("secrets")] 28 - [group("security")] 29 - @get-host-key host: 30 - nix shell nixpkgs#ssh-to-age nixpkgs#openssh \ 31 - --command ssh-keyscan localhost 2>/dev/null \ 32 - | ssh-to-age 2>/dev/null 33 - 34 - # Opens a secrets file for editing 35 - [group("secrets")] 36 - [group("security")] 37 - @edit-secrets file='secrets/default.yaml': 38 - sops {{ file }} 39 - 40 - # Enroll security key 41 - [group("security")] 42 - enroll-security-key: 43 - #!/usr/bin/env bash 44 - mkdir -p ~/.config/Yubico 45 - [ -e ~/.config/Yubico/u2f_keys ] \ 46 - && pamu2fcfg \ 47 - --origin="pam://localhost" \ 48 - --appid="pam://auth" \ 49 - --nouser \ 50 - >> ~/.config/Yubico/u2f_keys \ 51 - || pamu2fcfg \ 52 - --origin="pam://localhost" \ 53 - --appid="pam://auth" \ 54 - > ~/.config/Yubico/u2f_keys 55 - 56 - # Clear enrolled security keys, if any 57 - [group("security")] 58 - clear-security-keys: 59 - [ -e ~/.config/Yubico/u2f_keys ] \ 60 - && rm -f ~/.config/Yubico/u2f_keys 61 - 62 - # Generates the necessary keys in /etc/secureboot 63 - [group("secureboot")] 64 - [group("security")] 65 - create-secureboot-keys: 66 - sudo sbctl create-keys 67 - 68 - # Enrolls keys, requires system to be in setup mode 69 - [group("secureboot")] 70 - [group("security")] 71 - enroll-secureboot-keys: create-secureboot-keys 72 - sudo sbctl enroll-keys --microsoft 73 - 74 - # Opens the current stylix color scheme in a browser 75 - [group("theming")] 76 - @inspect-theme: 77 - firefox $(readlink -f /etc/stylix/palette.html) 78 - ''
+5
nix/shells/default.nix
··· 20 20 pkgs, 21 21 ... 22 22 }: { 23 + env = { 24 + EDITOR = "hx"; 25 + NH_FLAKE = inputs.self.lib.config.flake.path; 26 + }; 23 27 packages = 24 28 (with pkgs; [ 25 29 bat 26 30 fish 27 31 git 28 32 helix 33 + just 29 34 ]) 30 35 ++ config.pre-commit.settings.enabledPackages 31 36 ++ (lib.optionals (config.pre-commit.settings.package != null) [
+6 -8
nix/shells/deploy.nix
··· 1 - args: let 2 - inherit ((import ../lib args).config) flake repo; 3 - in { 4 - perSystem = {pkgs, ...}: { 1 + {inputs, ...}: { 2 + perSystem = {self', ...}: let 3 + inherit (inputs.self.lib.config) flake repo; 4 + inherit (self'.legacyPackages) pkgs; 5 + in { 5 6 make-shells.deploy = { 6 7 additionalArguments.meta.description = "Extra deployment utilities built-in"; 8 + inputsFrom = [self'.devShells.nix]; 7 9 packages = with pkgs; [ 8 10 disko 9 11 home-manager ··· 20 22 fi 21 23 '') 22 24 ]; 23 - shellHook = '' 24 - export EDITOR=hx 25 - export NH_FLAKE="${flake.path}" 26 - ''; 27 25 }; 28 26 }; 29 27 }