aboutsummaryrefslogtreecommitdiff
path: root/home/profiles
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-11-02 13:06:05 -0800
committerFranck Cuny <franck@fcuny.net>2025-11-02 13:06:05 -0800
commitcb961051f8307a0bfd6e75acb52a7b7ac003e4d0 (patch)
treec2e3e29716bf10bb5d95d2c11d8692672c379c5f /home/profiles
parentmove remote-unlock as a profile (diff)
downloadinfra-cb961051f8307a0bfd6e75acb52a7b7ac003e4d0.tar.gz
simplify configuration for darwin
Diffstat (limited to '')
-rw-r--r--home/profiles/bat.nix4
-rw-r--r--home/profiles/direnv.nix (renamed from home/programs/direnv.nix)0
-rw-r--r--home/profiles/eza.nix (renamed from home/programs/eza.nix)0
-rw-r--r--home/profiles/fd.nix (renamed from home/programs/fd.nix)2
-rw-r--r--home/profiles/fish.nix (renamed from home/programs/fish.nix)3
-rw-r--r--home/profiles/git.nix (renamed from home/programs/git.nix)2
-rw-r--r--home/profiles/go.nix (renamed from home/programs/go.nix)20
-rw-r--r--home/profiles/k8s.nix31
-rw-r--r--home/profiles/mac.nix51
-rw-r--r--home/profiles/media.nix34
-rw-r--r--home/profiles/minimal.nix13
-rw-r--r--home/profiles/onepassword.nix14
-rw-r--r--home/profiles/secrets.nix7
-rw-r--r--home/profiles/ssh.nix (renamed from home/programs/ssh.nix)6
-rw-r--r--home/profiles/starship.nix25
-rw-r--r--home/profiles/work.nix22
-rw-r--r--home/profiles/workstation.nix23
17 files changed, 179 insertions, 78 deletions
diff --git a/home/profiles/bat.nix b/home/profiles/bat.nix
new file mode 100644
index 0000000..a03ba62
--- /dev/null
+++ b/home/profiles/bat.nix
@@ -0,0 +1,4 @@
+{ ... }:
+{
+ programs.bat.enable = true;
+}
diff --git a/home/programs/direnv.nix b/home/profiles/direnv.nix
index bad971d..bad971d 100644
--- a/home/programs/direnv.nix
+++ b/home/profiles/direnv.nix
diff --git a/home/programs/eza.nix b/home/profiles/eza.nix
index f71b9b6..f71b9b6 100644
--- a/home/programs/eza.nix
+++ b/home/profiles/eza.nix
diff --git a/home/programs/fd.nix b/home/profiles/fd.nix
index cdbae66..8fc3a75 100644
--- a/home/programs/fd.nix
+++ b/home/profiles/fd.nix
@@ -1,12 +1,12 @@
{ ... }:
{
- # an alternative to find
programs.fd = {
enable = true;
hidden = true;
ignores = [
".git/"
".direnv/"
+ "vendor/"
];
};
}
diff --git a/home/programs/fish.nix b/home/profiles/fish.nix
index 0cbed8c..5adb99b 100644
--- a/home/programs/fish.nix
+++ b/home/profiles/fish.nix
@@ -16,9 +16,6 @@
nph = "nix profile history --profile /nix/var/nix/profiles/system";
nsn = "nix search nixpkgs";
nsv = "nix store verify --all";
-
- g = "git";
- gap = "git add --patch";
};
};
}
diff --git a/home/programs/git.nix b/home/profiles/git.nix
index 354dc71..c88705c 100644
--- a/home/programs/git.nix
+++ b/home/profiles/git.nix
@@ -9,8 +9,8 @@ let
in
{
home.packages = with pkgs; [
- gitAndTools.pre-commit
git-credential-manager
+ gitAndTools.pre-commit
];
programs.git = {
diff --git a/home/programs/go.nix b/home/profiles/go.nix
index 0ae1ec1..87e7add 100644
--- a/home/programs/go.nix
+++ b/home/profiles/go.nix
@@ -1,5 +1,11 @@
-{ pkgs, config, ... }:
+{ pkgs, ... }:
{
+ home.packages = with pkgs; [
+ go-tools # collection of tools, https://github.com/dominikh/go-tools
+ golangci-lint
+ gopls
+ ];
+
programs.go = {
enable = true;
goPath = ".local/share/pkg.go";
@@ -9,16 +15,4 @@
"github.com/fcuny/*"
];
};
-
- home.packages = with pkgs; [
- delve
- go-tools # collection of tools, https://github.com/dominikh/go-tools
- golangci-lint
- gopls
- ];
-
- home.sessionPath = [
- config.home.sessionVariables.GOBIN
- "${config.home.homeDirectory}/.local/bin"
- ];
}
diff --git a/home/profiles/k8s.nix b/home/profiles/k8s.nix
index 5eb4cf6..1e6cd41 100644
--- a/home/profiles/k8s.nix
+++ b/home/profiles/k8s.nix
@@ -1,22 +1,39 @@
-{ self, pkgs, ... }:
+{ pkgs, ... }:
{
-
- imports = [
- "${self}/home/programs/k9s.nix"
- "${self}/home/programs/kubie.nix"
- ];
-
home.packages = with pkgs; [
kind # k8s in docker
kubebuilder # generate controller
kubectl
+ kubie # kubeconfig browser https://github.com/sbstp/kubie
kubernetes-helm # deploy applications
kubelogin-oidc # OIDC plugin
];
+ programs.k9s = {
+ enable = true;
+ settings = {
+ k9s = {
+ refreshRate = 1;
+ };
+ };
+ };
+
+ home.file.kubie = {
+ target = ".kube/kubie.yaml";
+ text = ''
+ shell: fish
+ configs:
+ include:
+ - ~/.kube/rksconfig
+ prompt:
+ fish_use_rprompt: false
+ '';
+ };
+
programs.fish = {
shellAbbrs = {
k = "kubectl";
+ kctx = "kubie ctx";
klogs = "kubectl logs";
};
shellAliases = {
diff --git a/home/profiles/mac.nix b/home/profiles/mac.nix
index 4eb237b..01a891a 100644
--- a/home/profiles/mac.nix
+++ b/home/profiles/mac.nix
@@ -1,52 +1,45 @@
-{ self, pkgs, ... }:
{
+ pkgs,
+ config,
+ ...
+}:
+let
+
+ inherit (config.home) username;
+in
+{
+ age = {
+ identityPaths = [ "${config.home.homeDirectory}/.ssh/agenix" ];
+ secretsDir = "${config.home.homeDirectory}/.local/share/agenix";
+ };
+
imports = [
- "${self}/home/programs/alacritty"
- "${self}/home/programs/bat.nix"
- "${self}/home/programs/direnv.nix"
- "${self}/home/programs/emacs"
- "${self}/home/programs/eza.nix"
- "${self}/home/programs/fd.nix"
- "${self}/home/programs/firefox"
- "${self}/home/programs/fish.nix"
- "${self}/home/programs/gh.nix"
- "${self}/home/programs/git.nix"
- "${self}/home/programs/go.nix"
- "${self}/home/programs/onepassword.nix"
- "${self}/home/programs/rust.nix"
- "${self}/home/programs/ssh.nix"
- "${self}/home/programs/starship.nix"
- "${self}/home/programs/tmux.nix"
- ./secrets.nix
+ ./fish.nix
+ ./ssh.nix
+ ./onepassword.nix
+ ../programs/emacs
+ ../programs/firefox
];
+ home.homeDirectory = "/Users/${username}";
+
home.packages = with pkgs; [
age
aider-chat
bandwhich
- basedpyright
- bottom
coreutils
+ delve
dive # explore layers in docker images
docker
docker-credential-helpers
- dust
- jless
- jq
nil # nix lsp
nix-direnv # integration with direnv
nixfmt-rfc-style # new formatter
procs
- python3
restic
- ripgrep
- ruff
shellcheck
- tree
- uv
wget
wireshark
- yq
];
home.sessionVariables = {
diff --git a/home/profiles/media.nix b/home/profiles/media.nix
index 28a8663..a2cfd9d 100644
--- a/home/profiles/media.nix
+++ b/home/profiles/media.nix
@@ -1,4 +1,4 @@
-{ pkgs, self, ... }:
+{ pkgs, ... }:
{
home.packages = with pkgs; [
ffmpeg
@@ -6,8 +6,32 @@
vlc-bin
];
- imports = [
- "${self}/home/programs/yt-dlp.nix"
- "${self}/home/programs/mpv.nix"
- ];
+ programs.mpv = {
+ enable = true;
+ config = {
+ screenshot-directory = "~/Documents/screenshots";
+ ontop = true;
+ profile = "gpu-hq";
+ };
+ scripts = with pkgs.mpvScripts; [
+ sponsorblock
+ quality-menu # Switch video quality from YT on-the-go
+ vr-reversal # Script for mpv to play VR video with optional saving of head tracking data
+ ];
+ };
+
+ programs.yt-dlp = {
+ enable = true;
+
+ settings = {
+ mtime = false;
+ merge-output-format = "mkv";
+ restrict-filenames = true;
+ embed-thumbnail = true;
+ embed-metadata = true;
+ embed-chapters = true;
+ sponsorblock-mark = "sponsor";
+ output = "~/Movies/%(uploader)s/%(upload_date>%Y-%m-%d)s-%(title)s-%(id)s.%(ext)s";
+ };
+ };
}
diff --git a/home/profiles/minimal.nix b/home/profiles/minimal.nix
new file mode 100644
index 0000000..f3aef75
--- /dev/null
+++ b/home/profiles/minimal.nix
@@ -0,0 +1,13 @@
+{ config, ... }:
+let
+ inherit (config.home) username;
+in
+{
+ imports = [
+ ./bat.nix
+ ./eza.nix
+ ];
+
+ home.homeDirectory = "/home/${username}";
+ home.stateVersion = "25.05";
+}
diff --git a/home/profiles/onepassword.nix b/home/profiles/onepassword.nix
new file mode 100644
index 0000000..232092e
--- /dev/null
+++ b/home/profiles/onepassword.nix
@@ -0,0 +1,14 @@
+{ config, ... }:
+{
+ programs.onepassword = {
+ enable = true;
+ sshKeys = [
+ { account = "my.1password.com"; } # All keys from personal account
+ ];
+ };
+
+ home.sessionPath = [
+ config.home.sessionVariables.GOBIN
+ "${config.home.homeDirectory}/.local/bin"
+ ];
+}
diff --git a/home/profiles/secrets.nix b/home/profiles/secrets.nix
deleted file mode 100644
index 986a9e9..0000000
--- a/home/profiles/secrets.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{ config, ... }:
-{
- age = {
- identityPaths = [ "${config.home.homeDirectory}/.ssh/agenix" ];
- secretsDir = "${config.home.homeDirectory}/.local/share/agenix";
- };
-}
diff --git a/home/programs/ssh.nix b/home/profiles/ssh.nix
index c236904..250aff5 100644
--- a/home/programs/ssh.nix
+++ b/home/profiles/ssh.nix
@@ -1,6 +1,5 @@
-{ pkgs, config, ... }:
+{ config, ... }:
{
- # https://github.com/nix-community/home-manager/blob/master/modules/programs/ssh.nix
programs.ssh = {
enable = true;
forwardAgent = true;
@@ -10,9 +9,6 @@
controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p";
matchBlocks = {
- "git.fcuny.net" = {
- proxyCommand = "${pkgs.cloudflared}/bin/cloudflared access ssh --hostname %h";
- };
"github.com" = {
hostname = "github.com";
user = "git";
diff --git a/home/profiles/starship.nix b/home/profiles/starship.nix
new file mode 100644
index 0000000..5f0f87a
--- /dev/null
+++ b/home/profiles/starship.nix
@@ -0,0 +1,25 @@
+{ ... }:
+{
+ programs.starship = {
+ enable = true;
+ settings = {
+ add_newline = false;
+ character = {
+ success_symbol = "[›](bold green)";
+ error_symbol = "[›](bold red)";
+ };
+ "$schema" = "https://starship.rs/config-schema.json";
+ hostname = {
+ ssh_only = true;
+ };
+ username = {
+ disabled = true;
+ };
+ kubernetes = {
+ disabled = false;
+ style = "bold blue";
+ };
+ nix_shell.disabled = false;
+ };
+ };
+}
diff --git a/home/profiles/work.nix b/home/profiles/work.nix
index 28cf820..04dc61e 100644
--- a/home/profiles/work.nix
+++ b/home/profiles/work.nix
@@ -1,9 +1,4 @@
-{
- lib,
- self,
- pkgs,
- ...
-}:
+{ lib, pkgs, ... }:
let
nomad-prod = pkgs.writeShellScriptBin "nomad-prod" ''
set -e
@@ -53,7 +48,6 @@ let
in
{
imports = [
- "${self}/home/programs/gh.nix"
./k8s.nix
];
@@ -68,6 +62,19 @@ in
vault
];
+ programs.gh = {
+ enable = true;
+ settings = {
+ version = 1;
+ git_protocol = "ssh";
+ prompt = "enabled";
+ aliases = {
+ co = "pr checkout";
+ vw = "pr view --web";
+ };
+ };
+ };
+
programs.onepassword.sshKeys = lib.mkAfter [
{
account = "roblox.1password.com";
@@ -79,6 +86,7 @@ in
shellAbbrs =
let
environments = [
+ o
{
name = "chi1";
alias = "chi1";
diff --git a/home/profiles/workstation.nix b/home/profiles/workstation.nix
new file mode 100644
index 0000000..0494281
--- /dev/null
+++ b/home/profiles/workstation.nix
@@ -0,0 +1,23 @@
+{ pkgs, ... }:
+{
+ imports = [
+ ./bat.nix
+ ./eza.nix
+ ./direnv.nix
+ ./go.nix
+ ./starship.nix
+ ./fd.nix
+ ./git.nix
+ ];
+
+ home.packages = with pkgs; [
+ bottom
+ dust
+ fish
+ jless
+ jq
+ ripgrep
+ tree
+ yq
+ ];
+}