Compare commits
10 Commits
595cabbb88
...
254d7a30d3
| Author | SHA1 | Date | |
|---|---|---|---|
| 254d7a30d3 | |||
| 394865be38 | |||
| 01f4b70159 | |||
| 6a0fc31f1d | |||
| effb6111fa | |||
| 43a6943ce6 | |||
| 8f3fd6e0dc | |||
| 07a5c3e1f9 | |||
| 3b61703378 | |||
| b12d77708c |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,8 +1,10 @@
|
||||
#
|
||||
.claude/
|
||||
home/hosts/work/packages.local.nix
|
||||
|
||||
# ---> Nix
|
||||
# Ignore build outputs from performing a nix-build or `nix build` command
|
||||
result
|
||||
result-*
|
||||
|
||||
nixos-efi-vars.fd
|
||||
|
||||
home/hosts/work/packages.local.nix
|
||||
|
||||
@@ -2,12 +2,12 @@ local ts = require("treesj")
|
||||
local vim = vim
|
||||
local keymap = vim.keymap
|
||||
local opt = vim.opt
|
||||
local treesitter_configs = require("nvim-treesitter.configs")
|
||||
local treesitter = require("nvim-treesitter")
|
||||
|
||||
local nixCatsUtils = require("nixCatsUtils")
|
||||
local is_nix = nixCatsUtils.isNixCats
|
||||
|
||||
treesitter_configs.setup({
|
||||
treesitter.setup({
|
||||
-- Basically added what I might need from the docs
|
||||
-- <https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#supported-languages>
|
||||
ensure_installed = is_nix and {} or {
|
||||
|
||||
37
dots/.config/nvim/flake.lock
generated
37
dots/.config/nvim/flake.lock
generated
@@ -42,11 +42,11 @@
|
||||
},
|
||||
"nixCats": {
|
||||
"locked": {
|
||||
"lastModified": 1767159145,
|
||||
"narHash": "sha256-rnx/0p6D7rKd7mjtgsdSZjpkutJMzUaVyo2mj0rmjWQ=",
|
||||
"lastModified": 1767604651,
|
||||
"narHash": "sha256-itAnxzTpWpY1s3LA/oNngOuZDXT5U5JUZP5fApwx9gs=",
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nixCats-nvim",
|
||||
"rev": "479ab18fbeabaf87564d3fb0eaf99ebebb05f2f8",
|
||||
"rev": "3c9bc4d7123e1b48d92f25ba505b889af541e897",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -73,16 +73,16 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1767767207,
|
||||
"narHash": "sha256-Mj3d3PfwltLmukFal5i3fFt27L6NiKXdBezC1EBuZs4=",
|
||||
"lastModified": 1768302833,
|
||||
"narHash": "sha256-h5bRFy9bco+8QcK7rGoOiqMxMbmn21moTACofNLRMP4=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5912c1772a44e31bf1c63c0390b90501e5026886",
|
||||
"rev": "61db79b0c6b838d9894923920b612048e1201926",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -103,22 +103,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugins-crazy-node-movement": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1693654676,
|
||||
"narHash": "sha256-hQcQEp39zFN2zphMfcr97yRVcuHhBsSkzKO7XNloDpQ=",
|
||||
"owner": "theHamsta",
|
||||
"repo": "crazy-node-movement",
|
||||
"rev": "d5cf01cc44c5715501d3d6fe439af7c8b7fa5df2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "theHamsta",
|
||||
"repo": "crazy-node-movement",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugins-helm-ls-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -138,11 +122,11 @@
|
||||
"plugins-m-taskwarrior-d-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1764933759,
|
||||
"narHash": "sha256-4lN/ZQTQ7uMcpjePbf2k913Bs9AYYS6da3iZbckA6oI=",
|
||||
"lastModified": 1767960157,
|
||||
"narHash": "sha256-ov0qi4LhIlwqrBzSbTJ6APC5qjl2d/vlKWJfW5ZiDrg=",
|
||||
"owner": "huantrinh1802",
|
||||
"repo": "m_taskwarrior_d.nvim",
|
||||
"rev": "279d2c8bcd2779500c1bea71fb9249c97cdb503b",
|
||||
"rev": "107247387cd81823046bc2b8e71150c8edf041d3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -221,7 +205,6 @@
|
||||
"nixCats": "nixCats",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"plugins-beancount-nvim": "plugins-beancount-nvim",
|
||||
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
|
||||
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
|
||||
"plugins-m-taskwarrior-d-nvim": "plugins-m-taskwarrior-d-nvim",
|
||||
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
url = "github:huantrinh1802/m_taskwarrior_d.nvim";
|
||||
flake = false;
|
||||
};
|
||||
plugins-crazy-node-movement = {
|
||||
url = "github:theHamsta/crazy-node-movement";
|
||||
flake = false;
|
||||
};
|
||||
plugins-beancount-nvim = {
|
||||
url = "github:polarmutex/beancount.nvim";
|
||||
flake = false;
|
||||
@@ -84,6 +80,7 @@
|
||||
prettierd
|
||||
rustfmt
|
||||
shellcheck-minimal
|
||||
stylelint
|
||||
stylua
|
||||
tree-sitter
|
||||
vscode-langservers-extracted
|
||||
@@ -136,10 +133,9 @@
|
||||
pkgs.neovimPlugins.shipwright-nvim
|
||||
lush-nvim
|
||||
zenbones-nvim
|
||||
pkgs.neovimPlugins.crazy-node-movement
|
||||
nvim-treesitter.withAllGrammars
|
||||
# nvim-treesitter-textobjects
|
||||
# nvim-treesitter-context
|
||||
nvim-treesitter-textobjects
|
||||
nvim-treesitter-context
|
||||
nvim-ts-context-commentstring
|
||||
treesj
|
||||
sniprun
|
||||
@@ -217,7 +213,7 @@
|
||||
name = defaultPackageName;
|
||||
packages = [ defaultPackage ];
|
||||
inputsFrom = [ ];
|
||||
shellHook = '''';
|
||||
shellHook = "";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
65
flake.lock
generated
65
flake.lock
generated
@@ -29,11 +29,11 @@
|
||||
},
|
||||
"locked": {
|
||||
"dir": "pkgs/firefox-addons",
|
||||
"lastModified": 1767585814,
|
||||
"narHash": "sha256-7iodv57Ppq05AHVKnS9/IdhhgBYTVpTDZmz2u2enr/E=",
|
||||
"lastModified": 1768363414,
|
||||
"narHash": "sha256-9LW3RqHM13WnhhpAZjZA0i/SdPAOZg4R2kG/kUD0aO0=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "66bfeb87deb83ca2f9fa2045704b72de52c6433a",
|
||||
"rev": "1abc7eea7d965009e7d7fdc683985b3245933fb3",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
@@ -90,11 +90,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1767556355,
|
||||
"narHash": "sha256-RDTUBDQBi9D4eD9iJQWtUDN/13MDLX+KmE+TwwNUp2s=",
|
||||
"lastModified": 1768410656,
|
||||
"narHash": "sha256-9CfEGvHgQ8KdhBI5x6RVkuvqCCM7KiVxCM1n9e3lVBA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "f894bc4ffde179d178d8deb374fcf9855d1a82b7",
|
||||
"rev": "85c83f70968516f571015e260fb21c774e586c0b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -125,10 +125,10 @@
|
||||
"nix-secrets": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1765747965,
|
||||
"narHash": "sha256-EHZRRC3piD6vKd4hXiqC+CcDUQCOzrH/CNAF9zBqpDQ=",
|
||||
"lastModified": 1768414240,
|
||||
"narHash": "sha256-M/MObXs5oHjUGnKYMwU6Lrl/CfA1RMLGqJYytkfPXjg=",
|
||||
"ref": "main",
|
||||
"rev": "a8e8d953f579939bd72b5f5c6ed332910b598554",
|
||||
"rev": "601921b44c3794e899bd31c0f302e9a9f5e6c480",
|
||||
"shallow": true,
|
||||
"type": "git",
|
||||
"url": "ssh://git@github.com/hektor/nix-secrets"
|
||||
@@ -142,11 +142,11 @@
|
||||
},
|
||||
"nixCats": {
|
||||
"locked": {
|
||||
"lastModified": 1767159145,
|
||||
"narHash": "sha256-rnx/0p6D7rKd7mjtgsdSZjpkutJMzUaVyo2mj0rmjWQ=",
|
||||
"lastModified": 1767604651,
|
||||
"narHash": "sha256-itAnxzTpWpY1s3LA/oNngOuZDXT5U5JUZP5fApwx9gs=",
|
||||
"owner": "BirdeeHub",
|
||||
"repo": "nixCats-nvim",
|
||||
"rev": "479ab18fbeabaf87564d3fb0eaf99ebebb05f2f8",
|
||||
"rev": "3c9bc4d7123e1b48d92f25ba505b889af541e897",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -178,11 +178,11 @@
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1767185284,
|
||||
"narHash": "sha256-ljDBUDpD1Cg5n3mJI81Hz5qeZAwCGxon4kQW3Ho3+6Q=",
|
||||
"lastModified": 1768397375,
|
||||
"narHash": "sha256-7QqbFi3ERvKjEdAzEYPv7iSGwpUKSrQW5wPLMFq45AQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "40b1a28dce561bea34858287fbb23052c3ee63fe",
|
||||
"rev": "efe2094529d69a3f54892771b6be8ee4a0ebef0f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -194,11 +194,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1767379071,
|
||||
"narHash": "sha256-EgE0pxsrW9jp9YFMkHL9JMXxcqi/OoumPJYwf+Okucw=",
|
||||
"lastModified": 1768127708,
|
||||
"narHash": "sha256-1Sm77VfZh3mU0F5OqKABNLWxOuDeHIlcFjsXeeiPazs=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "fb7944c166a3b630f177938e478f0378e64ce108",
|
||||
"rev": "ffbc9f8cbaacfb331b6017d5a5abb21a492c9a38",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -232,7 +232,6 @@
|
||||
"nixpkgs"
|
||||
],
|
||||
"plugins-beancount-nvim": "plugins-beancount-nvim",
|
||||
"plugins-crazy-node-movement": "plugins-crazy-node-movement",
|
||||
"plugins-helm-ls-nvim": "plugins-helm-ls-nvim",
|
||||
"plugins-m-taskwarrior-d-nvim": "plugins-m-taskwarrior-d-nvim",
|
||||
"plugins-mcphub-nvim": "plugins-mcphub-nvim",
|
||||
@@ -266,22 +265,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugins-crazy-node-movement": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1693654676,
|
||||
"narHash": "sha256-hQcQEp39zFN2zphMfcr97yRVcuHhBsSkzKO7XNloDpQ=",
|
||||
"owner": "theHamsta",
|
||||
"repo": "crazy-node-movement",
|
||||
"rev": "d5cf01cc44c5715501d3d6fe439af7c8b7fa5df2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "theHamsta",
|
||||
"repo": "crazy-node-movement",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"plugins-helm-ls-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -301,11 +284,11 @@
|
||||
"plugins-m-taskwarrior-d-nvim": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1764933759,
|
||||
"narHash": "sha256-4lN/ZQTQ7uMcpjePbf2k913Bs9AYYS6da3iZbckA6oI=",
|
||||
"lastModified": 1767960157,
|
||||
"narHash": "sha256-ov0qi4LhIlwqrBzSbTJ6APC5qjl2d/vlKWJfW5ZiDrg=",
|
||||
"owner": "huantrinh1802",
|
||||
"repo": "m_taskwarrior_d.nvim",
|
||||
"rev": "279d2c8bcd2779500c1bea71fb9249c97cdb503b",
|
||||
"rev": "107247387cd81823046bc2b8e71150c8edf041d3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -398,11 +381,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1767499857,
|
||||
"narHash": "sha256-0zUU/PW09d6oBaR8x8vMHcAhg1MOvo3CwoXgHijzzNE=",
|
||||
"lastModified": 1768271704,
|
||||
"narHash": "sha256-jJqlW8A3OZ5tYbXphF7U8P8g/3Cn8PPwPa4YlJ/9agg=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "ecc41505948ec2ab0325f14c9862a4329c2b4190",
|
||||
"rev": "691b8b6713855d0fe463993867291c158472fc6f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -18,6 +18,7 @@ in
|
||||
../../modules/keepassxc.nix
|
||||
../../modules/anki.nix
|
||||
../../modules/browser
|
||||
../../modules/shell
|
||||
];
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
@@ -29,28 +30,12 @@ in
|
||||
|
||||
browser.primary = "librewolf";
|
||||
|
||||
shell.bash = {
|
||||
enable = true;
|
||||
aliases.lang-js = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
initExtra = ''
|
||||
for f in /home/${username}/.bashrc.d/*; do
|
||||
[ -f "$f" ] && source "$f"
|
||||
done
|
||||
|
||||
source /home/${username}/.bash_aliases/all
|
||||
source /home/${username}/.bash_aliases/lang-js
|
||||
|
||||
# host-specific config goes here
|
||||
# ...
|
||||
|
||||
export PATH=${../../../dots/.bin}:$PATH
|
||||
'';
|
||||
};
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
home-manager.enable = true;
|
||||
taskwarrior.config.recurrence = lib.mkForce "on";
|
||||
};
|
||||
@@ -61,11 +46,6 @@ in
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".inputrc".source = ../../../dots/.inputrc;
|
||||
".bashrc.d/prompt".source = ../../../dots/.bashrc.d/prompt;
|
||||
".bashrc.d/editor".source = ../../../dots/.bashrc.d/editor;
|
||||
".bash_aliases/all".source = ../../../dots/.bash_aliases/all;
|
||||
".bash_aliases/lang-js".source = ../../../dots/.bash_aliases/lang-js;
|
||||
".config/kitty/kitty.conf".source = ../../../dots/.config/kitty/kitty.conf;
|
||||
".config/kitty/themes/zenwritten_light.conf".source =
|
||||
../../../dots/.config/kitty/themes/zenwritten_light.conf;
|
||||
|
||||
@@ -16,6 +16,7 @@ in
|
||||
../../modules/taskwarrior.nix
|
||||
../../modules/keepassxc.nix
|
||||
../../modules/browser
|
||||
../../modules/shell
|
||||
];
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
@@ -27,28 +28,12 @@ in
|
||||
|
||||
browser.primary = "librewolf";
|
||||
|
||||
shell.bash = {
|
||||
enable = true;
|
||||
aliases.lang-js = true;
|
||||
};
|
||||
|
||||
programs = {
|
||||
bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
initExtra = ''
|
||||
for f in /home/${username}/.bashrc.d/*; do
|
||||
[ -f "$f" ] && source "$f"
|
||||
done
|
||||
|
||||
source /home/${username}/.bash_aliases/all
|
||||
source /home/${username}/.bash_aliases/lang-js
|
||||
|
||||
# host-specific config goes here
|
||||
# ...
|
||||
|
||||
export PATH=${../../../dots/.bin}:$PATH
|
||||
'';
|
||||
};
|
||||
fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
home-manager.enable = true;
|
||||
};
|
||||
|
||||
@@ -58,11 +43,6 @@ in
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".inputrc".source = ../../../dots/.inputrc;
|
||||
".bashrc.d/prompt".source = ../../../dots/.bashrc.d/prompt;
|
||||
".bashrc.d/editor".source = ../../../dots/.bashrc.d/editor;
|
||||
".bash_aliases/all".source = ../../../dots/.bash_aliases/all;
|
||||
".bash_aliases/lang-js".source = ../../../dots/.bash_aliases/lang-js;
|
||||
".config/kitty/kitty.conf".source = ../../../dots/.config/kitty/kitty.conf;
|
||||
".config/kitty/themes/zenwritten_light.conf".source =
|
||||
../../../dots/.config/kitty/themes/zenwritten_light.conf;
|
||||
|
||||
@@ -21,6 +21,7 @@ with pkgs;
|
||||
parallel
|
||||
pass
|
||||
pnpm
|
||||
python3
|
||||
ripgrep
|
||||
signal-desktop
|
||||
silver-searcher
|
||||
|
||||
@@ -10,13 +10,36 @@ let
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
../../modules/dconf.nix
|
||||
../../modules/git.nix
|
||||
../../modules/k9s.nix
|
||||
../../modules/keepassxc.nix
|
||||
../../modules/browser
|
||||
../../modules/taskwarrior.nix
|
||||
];
|
||||
|
||||
sops = {
|
||||
age.keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
|
||||
defaultSopsFile = "${inputs.nix-secrets}/secrets.yaml";
|
||||
|
||||
secrets = {
|
||||
taskwarrior_sync_server_url = {};
|
||||
taskwarrior_sync_server_client_id = {};
|
||||
taskwarrior_sync_encryption_secret = {};
|
||||
anki_sync_user = {};
|
||||
anki_sync_key = {};
|
||||
};
|
||||
|
||||
templates."taskrc.d/sync" = {
|
||||
content = ''
|
||||
sync.server.url=${config.sops.placeholder.taskwarrior_sync_server_url}
|
||||
sync.server.client_id=${config.sops.placeholder.taskwarrior_sync_server_client_id}
|
||||
sync.encryption_secret=${config.sops.placeholder.taskwarrior_sync_encryption_secret}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
|
||||
@@ -115,7 +115,7 @@ with pkgs;
|
||||
xmage
|
||||
yamllint
|
||||
yarn
|
||||
(python311.withPackages (ppkgs: [
|
||||
(python314.withPackages (ppkgs: [
|
||||
ppkgs.plyer
|
||||
ppkgs.dbus-python
|
||||
]))
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig ? null,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
hmSopsAvailable = config ? sops && config.sops ? secrets;
|
||||
osSopsAvailable = osConfig != null && osConfig ? sops && osConfig.sops ? secrets;
|
||||
sopsAvailable = hmSopsAvailable || osSopsAvailable;
|
||||
|
||||
sopsSecrets = if hmSopsAvailable then config.sops.secrets else osConfig.sops.secrets;
|
||||
in
|
||||
{
|
||||
warnings = lib.optional (
|
||||
!sopsAvailable && config.programs.anki.enable
|
||||
) "anki is enabled but sops secrets are not available. anki sync will not be configured.";
|
||||
|
||||
programs.anki = {
|
||||
enable = true;
|
||||
addons = with pkgs.ankiAddons; [
|
||||
@@ -8,9 +25,9 @@
|
||||
puppy-reinforcement
|
||||
review-heatmap
|
||||
];
|
||||
sync = {
|
||||
usernameFile = "${config.sops.secrets."anki_sync_user".path}";
|
||||
keyFile = "${config.sops.secrets."anki_sync_key".path}";
|
||||
sync = lib.mkIf sopsAvailable {
|
||||
usernameFile = "${sopsSecrets."anki_sync_user".path}";
|
||||
keyFile = "${sopsSecrets."anki_sync_key".path}";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
"librewolf"
|
||||
];
|
||||
default = "firefox";
|
||||
description = "Primary web browser";
|
||||
};
|
||||
|
||||
secondary = lib.mkOption {
|
||||
@@ -21,7 +20,6 @@
|
||||
]
|
||||
);
|
||||
default = null;
|
||||
description = "Optional secondary web browser";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
75
home/modules/shell/bash.nix
Normal file
75
home/modules/shell/bash.nix
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.shell.bash;
|
||||
username = config.home.username;
|
||||
dotsPath = ../../../dots;
|
||||
in
|
||||
{
|
||||
options.shell.bash = {
|
||||
enable = lib.mkEnableOption "bash configuration";
|
||||
|
||||
aliases = {
|
||||
all = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Enable common aliases";
|
||||
};
|
||||
lang-js = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable JavaScript/Node.js aliases";
|
||||
};
|
||||
};
|
||||
|
||||
addBinToPath = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Add dots .bin directory to PATH";
|
||||
};
|
||||
|
||||
extraInit = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = "";
|
||||
description = "Additional bash initialization";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
shell-utils.enable = lib.mkDefault true;
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
initExtra = ''
|
||||
for f in /home/${username}/.bashrc.d/*; do
|
||||
[ -f "$f" ] && source "$f"
|
||||
done
|
||||
|
||||
${lib.optionalString cfg.aliases.all "source /home/${username}/.bash_aliases/all"}
|
||||
${lib.optionalString cfg.aliases.lang-js "source /home/${username}/.bash_aliases/lang-js"}
|
||||
|
||||
${lib.optionalString cfg.addBinToPath "export PATH=${dotsPath}/.bin:$PATH"}
|
||||
|
||||
${cfg.extraInit}
|
||||
'';
|
||||
};
|
||||
|
||||
home.file =
|
||||
{
|
||||
".inputrc".source = dotsPath + "/.inputrc";
|
||||
".bashrc.d/prompt".source = dotsPath + "/.bashrc.d/prompt";
|
||||
".bashrc.d/editor".source = dotsPath + "/.bashrc.d/editor";
|
||||
}
|
||||
// lib.optionalAttrs cfg.aliases.all {
|
||||
".bash_aliases/all".source = dotsPath + "/.bash_aliases/all";
|
||||
}
|
||||
// lib.optionalAttrs cfg.aliases.lang-js {
|
||||
".bash_aliases/lang-js".source = dotsPath + "/.bash_aliases/lang-js";
|
||||
};
|
||||
};
|
||||
}
|
||||
7
home/modules/shell/default.nix
Normal file
7
home/modules/shell/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
imports = [
|
||||
./bash.nix
|
||||
./utils.nix
|
||||
./prompt.nix
|
||||
];
|
||||
}
|
||||
17
home/modules/shell/prompt.nix
Normal file
17
home/modules/shell/prompt.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.starship = {
|
||||
enable = lib.mkEnableOption "starship prompt";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.starship.enable {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
26
home/modules/shell/utils.nix
Normal file
26
home/modules/shell/utils.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.shell-utils = {
|
||||
enable = lib.mkEnableOption "shell utilities";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.shell-utils.enable {
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableBashIntegration = lib.mkDefault true;
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
ripgrep
|
||||
bat
|
||||
jq
|
||||
entr
|
||||
parallel
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -1,12 +1,24 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
osConfig ? null,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
hmSopsAvailable = config ? sops && config.sops ? templates;
|
||||
osSopsAvailable = osConfig != null && osConfig ? sops && osConfig.sops ? templates;
|
||||
sopsAvailable = hmSopsAvailable || osSopsAvailable;
|
||||
|
||||
sopsTemplates = if hmSopsAvailable then config.sops.templates else osConfig.sops.templates;
|
||||
in
|
||||
{
|
||||
warnings =
|
||||
lib.optional (!sopsAvailable && config.programs.taskwarrior.enable)
|
||||
"taskwarrior is enabled, but sops templates are not available. taskwarrior sync will not be configured.";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
python314
|
||||
libnotify
|
||||
];
|
||||
|
||||
@@ -35,17 +47,10 @@
|
||||
package = taskwarrior3;
|
||||
colorTheme = "dark-256";
|
||||
config = {
|
||||
# sync = {
|
||||
# server.url = "${builtins.readFile config.sops.secrets."taskwarrior_sync_server_url".path}";
|
||||
# server.client_id = "${builtins.readFile
|
||||
# config.sops.secrets."taskwarrior_sync_server_client_id".path
|
||||
# }";
|
||||
# encryption_secret = "${builtins.readFile
|
||||
# config.sops.secrets."taskwarrior_sync_encryption_secret".path
|
||||
# }";
|
||||
# };
|
||||
recurrence = "off";
|
||||
};
|
||||
extraConfig = "include ${config.sops.templates."taskrc.d/sync".path}";
|
||||
extraConfig = lib.optionalString sopsAvailable ''
|
||||
include ${sopsTemplates."taskrc.d/sync".path}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ in
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users.${username} = import ../../home/hosts/andromache {
|
||||
inherit lib;
|
||||
inherit inputs;
|
||||
|
||||
@@ -75,6 +75,7 @@ in
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users.${username} = import ../../home/hosts/astyanax {
|
||||
inherit inputs;
|
||||
inherit config;
|
||||
|
||||
@@ -58,6 +58,7 @@ in
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
users.${username} = import ../../home/hosts/vm {
|
||||
inherit inputs;
|
||||
inherit config;
|
||||
|
||||
@@ -16,7 +16,6 @@ in
|
||||
};
|
||||
config = {
|
||||
sops = {
|
||||
validateSopsFiles = false;
|
||||
defaultSopsFile = "${builtins.toString inputs.nix-secrets}/secrets.yaml";
|
||||
defaultSopsFormat = "yaml";
|
||||
age.keyFile = "/home/${cfg.username}/.config/sops/age/keys.txt";
|
||||
|
||||
Reference in New Issue
Block a user