about summary refs log tree commit diff
path: root/nix/users
diff options
context:
space:
mode:
Diffstat (limited to 'nix/users')
-rw-r--r--nix/users/fcuny/1password.nix14
-rw-r--r--nix/users/fcuny/darwin.nix3
-rw-r--r--nix/users/fcuny/git.nix18
-rw-r--r--nix/users/fcuny/go.nix16
-rw-r--r--nix/users/fcuny/home-manager.nix28
-rw-r--r--nix/users/fcuny/k8s.nix6
-rw-r--r--nix/users/fcuny/nixos.nix12
-rw-r--r--nix/users/fcuny/shell.nix17
-rw-r--r--nix/users/fcuny/ssh.nix19
-rw-r--r--nix/users/fcuny/work.nix6
10 files changed, 93 insertions, 46 deletions
diff --git a/nix/users/fcuny/1password.nix b/nix/users/fcuny/1password.nix
index fd1dfbe..bf8133f 100644
--- a/nix/users/fcuny/1password.nix
+++ b/nix/users/fcuny/1password.nix
@@ -1,11 +1,13 @@
 { config, ... }:
 let
   home = config.home.homeDirectory;
-  darwinSockPath =
-    "${home}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock";
+  darwinSockPath = "${home}/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock";
   sockPath = ".1password/agent.sock";
-in {
-  home.sessionVariables = { SSH_AUTH_SOCK = "${home}/${sockPath}"; };
+in
+{
+  home.sessionVariables = {
+    SSH_AUTH_SOCK = "${home}/${sockPath}";
+  };
 
   home.file.sock = {
     source = config.lib.file.mkOutOfStoreSymlink darwinSockPath;
@@ -18,7 +20,9 @@ in {
     '';
   };
 
-  programs.ssh = { extraConfig = "IdentityAgent ~/${sockPath}"; };
+  programs.ssh = {
+    extraConfig = "IdentityAgent ~/${sockPath}";
+  };
 
   # Generate ssh agent config for 1Password
   # I want both my personal and work keys
diff --git a/nix/users/fcuny/darwin.nix b/nix/users/fcuny/darwin.nix
index b882bc5..1291031 100644
--- a/nix/users/fcuny/darwin.nix
+++ b/nix/users/fcuny/darwin.nix
@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
   nixpkgs.overlays = import ../../../nix/lib/overlays.nix;
 
   # The user should already exist, but we need to set this up so Nix knows
diff --git a/nix/users/fcuny/git.nix b/nix/users/fcuny/git.nix
index c89454b..9f7023a 100644
--- a/nix/users/fcuny/git.nix
+++ b/nix/users/fcuny/git.nix
@@ -1,4 +1,5 @@
-{ lib, pkgs, ... }: {
+{ lib, pkgs, ... }:
+{
   home.packages = with pkgs; [
     gitAndTools.pre-commit
     git-credential-manager
@@ -10,7 +11,9 @@
     userName = "Franck Cuny";
     userEmail = "franck@fcuny.net";
 
-    aliases = { amend = "commit --amend"; };
+    aliases = {
+      amend = "commit --amend";
+    };
 
     # https://stackoverflow.com/questions/74012449/git-includeif-hasconfigremote-url-not-working
     # to test it's working as expected:
@@ -19,17 +22,18 @@
     includes = [
       {
         condition = "hasconfig:remote.*.url:git@github.rbx.com:*/**";
-        path = pkgs.writeText "username.cfg"
-          (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; });
+        path = pkgs.writeText "username.cfg" (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; });
       }
       {
         condition = "hasconfig:remote.*.url:git@github.com:Roblox/**";
-        path = pkgs.writeText "username.cfg"
-          (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; });
+        path = pkgs.writeText "username.cfg" (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; });
       }
     ];
 
-    ignores = [ ".envrc" ".direnv" ];
+    ignores = [
+      ".envrc"
+      ".direnv"
+    ];
 
     extraConfig = {
       core.whitespace = "trailing-space,space-before-tab";
diff --git a/nix/users/fcuny/go.nix b/nix/users/fcuny/go.nix
index b52f89e..401abe3 100644
--- a/nix/users/fcuny/go.nix
+++ b/nix/users/fcuny/go.nix
@@ -1,11 +1,21 @@
-{ config, pkgs, ... }: {
-  home.packages = with pkgs; [ go-tools golangci-lint gopls delve ];
+{ config, pkgs, ... }:
+{
+  home.packages = with pkgs; [
+    go-tools
+    golangci-lint
+    gopls
+    delve
+  ];
 
   programs.go = {
     enable = true;
     goPath = ".local/share/pkg.go";
     goBin = ".local/bin.go";
-    goPrivate = [ "github.rbx.com/*" "github.com/fcuny/*" "git.fcuny.net/*" ];
+    goPrivate = [
+      "github.rbx.com/*"
+      "github.com/fcuny/*"
+      "git.fcuny.net/*"
+    ];
   };
 
   home.sessionPath = [ config.home.sessionVariables.GOBIN ];
diff --git a/nix/users/fcuny/home-manager.nix b/nix/users/fcuny/home-manager.nix
index e975c37..e450c24 100644
--- a/nix/users/fcuny/home-manager.nix
+++ b/nix/users/fcuny/home-manager.nix
@@ -1,26 +1,34 @@
 { darwin, systemName, ... }:
 
-{ lib, pkgs, ... }: {
+{ lib, pkgs, ... }:
+{
   home.stateVersion = "23.05";
 
   xdg.enable = true;
 
-  imports = [ ./shell.nix ./ssh.nix ./git.nix ]
-    ++ lib.optionals darwin [ ./1password.nix ./go.nix ]
+  imports =
+    [
+      ./shell.nix
+      ./ssh.nix
+      ./git.nix
+    ]
+    ++ lib.optionals darwin [
+      ./1password.nix
+      ./go.nix
+    ]
     ++ lib.optionals (systemName == "hq-c02fk3q7md6t") [ ./work.nix ];
 
-  home.packages = with pkgs;
+  home.packages =
+    with pkgs;
     [
       # encryption
       age
 
-      # nix
       nil # nix lsp
-      nix-direnv
-      nixd
-      nixfmt-classic
-      nixpkgs-fmt
-    ] ++ (lib.optionals (darwin) [
+      nix-direnv # integration with direnv
+      nixfmt-rfc-style # new formatter
+    ]
+    ++ (lib.optionals (darwin) [
       # media
       mpv
       ffmpeg
diff --git a/nix/users/fcuny/k8s.nix b/nix/users/fcuny/k8s.nix
index 88a7350..cbc04ef 100644
--- a/nix/users/fcuny/k8s.nix
+++ b/nix/users/fcuny/k8s.nix
@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
   home.packages = with pkgs; [
     kind # k8s in docker
     kubebuilder # generate controller
@@ -31,8 +32,7 @@
       klogs = "kubectl logs";
     };
     shellAliases = {
-      ukctx =
-        "${pkgs.gh}/bin/gh api --hostname github.rbx.com repos/Roblox/cell-lifecycle/contents/rks/kubeconfig --jq '.content' | base64 -d > ~/.kube/rksconfig";
+      ukctx = "${pkgs.gh}/bin/gh api --hostname github.rbx.com repos/Roblox/cell-lifecycle/contents/rks/kubeconfig --jq '.content' | base64 -d > ~/.kube/rksconfig";
     };
   };
 }
diff --git a/nix/users/fcuny/nixos.nix b/nix/users/fcuny/nixos.nix
index 4cc80bd..a6c302f 100644
--- a/nix/users/fcuny/nixos.nix
+++ b/nix/users/fcuny/nixos.nix
@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
   # add ~/.local/bin to PATH
   environment.localBinInPath = true;
 
@@ -8,10 +9,13 @@
   users.users.fcuny = {
     isNormalUser = true;
     home = "/home/fcuny";
-    extraGroups = [ "docker" "wheel" "podman" ];
+    extraGroups = [
+      "docker"
+      "wheel"
+      "podman"
+    ];
     shell = pkgs.fish;
-    hashedPassword =
-      "$6$U4GoqhuHgdr.h0JP$C/BKslQfOpPJ5lUzrTeQh6i859R/jEKYSF9MaRhWYo5VG6aCDKsvb5xKSifH4nQt6okJixG9ceFh..Mnt93Jt/";
+    hashedPassword = "$6$U4GoqhuHgdr.h0JP$C/BKslQfOpPJ5lUzrTeQh6i859R/jEKYSF9MaRhWYo5VG6aCDKsvb5xKSifH4nQt6okJixG9ceFh..Mnt93Jt/";
     openssh.authorizedKeys.keys = [
       # key `nixos` in 1password
       "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINBkozy+X96u5ciX766bJ/AyQ3xm1tXZTIr5+4PVFZFi"
diff --git a/nix/users/fcuny/shell.nix b/nix/users/fcuny/shell.nix
index d95c74d..e690437 100644
--- a/nix/users/fcuny/shell.nix
+++ b/nix/users/fcuny/shell.nix
@@ -1,7 +1,10 @@
 { config, pkgs, ... }:
-let isLinux = pkgs.stdenv.isLinux;
-in {
-  home.packages = with pkgs;
+let
+  isLinux = pkgs.stdenv.isLinux;
+in
+{
+  home.packages =
+    with pkgs;
     [
       # shell
       shellcheck
@@ -28,7 +31,8 @@ in {
       aspellDicts.en
       aspellDicts.en-computers
       aspellDicts.en-science
-    ] ++ (lib.optionals (isLinux) [ htop ]);
+    ]
+    ++ (lib.optionals (isLinux) [ htop ]);
 
   # https://github.com/nix-community/home-manager/blob/master/modules/programs/fish.nix
   programs.fish = {
@@ -65,7 +69,10 @@ in {
   programs.fd = {
     enable = true;
     hidden = true;
-    ignores = [ ".git/" ".direnv/" ];
+    ignores = [
+      ".git/"
+      ".direnv/"
+    ];
   };
 
   programs.direnv = {
diff --git a/nix/users/fcuny/ssh.nix b/nix/users/fcuny/ssh.nix
index 2129650..004d44f 100644
--- a/nix/users/fcuny/ssh.nix
+++ b/nix/users/fcuny/ssh.nix
@@ -1,4 +1,5 @@
-{ ... }: {
+{ ... }:
+{
   # https://github.com/nix-community/home-manager/blob/master/modules/programs/ssh.nix
   programs.ssh = {
     enable = true;
@@ -12,26 +13,34 @@
         hostname = "github.com";
         user = "git";
         forwardAgent = false;
-        extraOptions = { preferredAuthentications = "publickey"; };
+        extraOptions = {
+          preferredAuthentications = "publickey";
+        };
       };
       "github.rbx.com" = {
         hostname = "github.rbx.com";
         user = "git";
         forwardAgent = false;
-        extraOptions = { preferredAuthentications = "publickey"; };
+        extraOptions = {
+          preferredAuthentications = "publickey";
+        };
       };
       "git" = {
         hostname = "git.fcuny.net";
         port = 422;
         user = "git";
         forwardAgent = false;
-        extraOptions = { preferredAuthentications = "publickey"; };
+        extraOptions = {
+          preferredAuthentications = "publickey";
+        };
       };
       "home" = {
         hostname = "fcuny.net";
         port = 422;
         user = "fcuny";
-        extraOptions = { preferredAuthentications = "publickey"; };
+        extraOptions = {
+          preferredAuthentications = "publickey";
+        };
       };
     };
   };
diff --git a/nix/users/fcuny/work.nix b/nix/users/fcuny/work.nix
index 67d7bdb..04cf7dc 100644
--- a/nix/users/fcuny/work.nix
+++ b/nix/users/fcuny/work.nix
@@ -1,4 +1,5 @@
-{ pkgs, ... }: {
+{ pkgs, ... }:
+{
   imports = [ ./k8s.nix ];
 
   home.packages = with pkgs; [
@@ -16,8 +17,7 @@
 
   programs.fish = {
     shellAbbrs = {
-      "ssh-sign-chi" =
-        "${pkgs.hashi}/bin/hashi -e chi1 sign --key=(op read 'op://employee/default rbx ssh key/public key'|psub) key";
+      "ssh-sign-chi" = "${pkgs.hashi}/bin/hashi -e chi1 sign --key=(op read 'op://employee/default rbx ssh key/public key'|psub) key";
     };
   };
 }