Factor out home manager a little better
This commit is contained in:
parent
2096c3b09e
commit
0e3427418f
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./ssh.nix
|
||||
./fish.nix
|
||||
./git.nix
|
||||
];
|
||||
programs.home-manager.enable = true;
|
||||
}
|
83
flake.lock
83
flake.lock
|
@ -62,11 +62,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1652700427,
|
||||
"narHash": "sha256-Tzuqx7w3CIN/kZRE1hjMMsB3oC+39OoCUpgbw4it3RI=",
|
||||
"lastModified": 1652728347,
|
||||
"narHash": "sha256-bvf6IgRsHidrFnx3tDQef3huPxYWqZEb1G0gS6bxQG4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "emacs-overlay",
|
||||
"rev": "e9f4792aa79bccedb34b3fc04d1a36f1848b7b57",
|
||||
"rev": "513a50dbc4589f33abca1f8d1084496fbb70a08e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -192,11 +192,11 @@
|
|||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1652557277,
|
||||
"narHash": "sha256-jSes9DaIVMdmwBB78KkFUVrlDzawmD62vrUg0GS2500=",
|
||||
"lastModified": 1652733177,
|
||||
"narHash": "sha256-mRpdBbVk8tbYVgEE6oTBbFT1vkVdF7EzaP7bMQ26wWA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "12806d31a381e7cd169a6bac35590e7b36dc5fe5",
|
||||
"rev": "04b4d989fda8f14e6fcd1fee631eab9c54d15b97",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -220,6 +220,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_3": {
|
||||
"locked": {
|
||||
"lastModified": 1652733177,
|
||||
"narHash": "sha256-mRpdBbVk8tbYVgEE6oTBbFT1vkVdF7EzaP7bMQ26wWA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "04b4d989fda8f14e6fcd1fee631eab9c54d15b97",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"format-all": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -255,6 +270,27 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager_2": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nix-on-droid",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1652452047,
|
||||
"narHash": "sha256-O6DI0dMH/5rNM+z9CQ/nqRMNBpNsU7TtLSsafKLZTHY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "32a7da69dc53c9eb5ad0675eb7fdc58f7fe35272",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"libnbtplusplus": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -328,6 +364,28 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-on-droid": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_3",
|
||||
"home-manager": "home-manager_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1650613939,
|
||||
"narHash": "sha256-x+OlhRDWXpqFZKmeEOE+vXbmt9kiCe35rKVBcJo3gxQ=",
|
||||
"owner": "t184256",
|
||||
"repo": "nix-on-droid",
|
||||
"rev": "e7e7d1347ffa88f8f67852a58a94d339c7d58fa0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "t184256",
|
||||
"repo": "nix-on-droid",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-straight": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
@ -378,11 +436,11 @@
|
|||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1652572281,
|
||||
"narHash": "sha256-UEsrB5XBOj0blVe2ldc0lHvlhLYZJDHroELMHlg7XxA=",
|
||||
"lastModified": 1652659998,
|
||||
"narHash": "sha256-FqNrXC1EE6U2RACwXBlsAvg1lqQGLYpuYb6+W3DL9vA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "43ff6cb1c027d13dc938b88eb099462210fea52f",
|
||||
"rev": "1d7db1b9e4cf1ee075a9f52e5c36f7b9f4207502",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -544,11 +602,11 @@
|
|||
"quazip": "quazip"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1652647253,
|
||||
"narHash": "sha256-oyMfCZsDrPXjWnZ4gqdZQt6YrvPN57qfThini+sr+BQ=",
|
||||
"lastModified": 1652724419,
|
||||
"narHash": "sha256-Ny/Mx1JspwhWsRHExcmW7Yiix6P8/V6dDJ1DbXRY82s=",
|
||||
"owner": "PolyMC",
|
||||
"repo": "PolyMC",
|
||||
"rev": "a67f3131e7585615d7d759963bfc7676d2728e67",
|
||||
"rev": "f66598db8aa756871dc21081e890158f889dc9e3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -597,6 +655,7 @@
|
|||
"home-manager": "home-manager",
|
||||
"mozilla": "mozilla",
|
||||
"nix-doom-emacs": "nix-doom-emacs",
|
||||
"nix-on-droid": "nix-on-droid",
|
||||
"nixpkgs": "nixpkgs_3",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"polymc": "polymc",
|
||||
|
|
33
flake.nix
33
flake.nix
|
@ -30,9 +30,13 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.emacs-overlay.follows = "emacs";
|
||||
};
|
||||
nix-on-droid = {
|
||||
url = "github:t184256/nix-on-droid";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, fenix, emacs, mozilla, sops-nix, home-manager, darwin, polymc, nix-doom-emacs }:
|
||||
outputs = { self, nixpkgs, nixpkgs-unstable, fenix, emacs, mozilla, sops-nix, home-manager, darwin, polymc, nix-doom-emacs, nix-on-droid }:
|
||||
let
|
||||
baseModules = [
|
||||
./applications/utils-core.nix
|
||||
|
@ -62,7 +66,6 @@
|
|||
./modules/common.nix
|
||||
./modules/ssh.nix
|
||||
sops-nix.nixosModules.sops
|
||||
home-manager.nixosModules.home-manager
|
||||
## Setup sops
|
||||
({ pkgs, config, ... }: {
|
||||
# Add default secrets
|
||||
|
@ -76,10 +79,19 @@
|
|||
sopsFile = ./secrets/lastfm.conf;
|
||||
};
|
||||
})
|
||||
## Setup home manager
|
||||
];
|
||||
baseHomeModules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users.nathan = import ./home-manager/common.nix;
|
||||
};
|
||||
}
|
||||
./home.nix
|
||||
];
|
||||
desktopModules = coreModules ++ [
|
||||
desktopModules = baseHomeModules ++ coreModules ++ [
|
||||
./modules/audio.nix
|
||||
./modules/sway.nix
|
||||
./modules/fonts.nix
|
||||
|
@ -101,7 +113,7 @@
|
|||
./applications/syncthing.nix
|
||||
./desktop.nix
|
||||
];
|
||||
serverModules = coreModules ++ [
|
||||
serverModules = baseHomeModules ++ coreModules ++ [
|
||||
./home-linux.nix
|
||||
./modules/zt.nix
|
||||
./modules/autoupdate.nix
|
||||
|
@ -244,5 +256,16 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
homeConfigurations.linux =
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
in
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
configuration = import ./home-manager/linux.nix;
|
||||
inherit system;
|
||||
username = "nathan";
|
||||
homeDirectory = "/home/nathan";
|
||||
stateVersion = "21.11";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./ssh.nix
|
||||
./git.nix
|
||||
./fish.nix
|
||||
];
|
||||
programs.home-manager.enable = true;
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
## Shell
|
||||
# Shell proper
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
# Setup our aliases
|
||||
shellAliases = {
|
||||
ls = "exa --icons";
|
||||
la = "exa --icons -a";
|
||||
lg = "exa --icons --git";
|
||||
cat = "bat";
|
||||
dig = "dog";
|
||||
df = "duf";
|
||||
};
|
||||
# Custom configuration
|
||||
interactiveShellInit = ''
|
||||
# Setup any-nix-shell
|
||||
any-nix-shell fish --info-right | source
|
||||
# Load logger function
|
||||
source ~/.config/fish/functions/cmdlogger.fish
|
||||
'';
|
||||
functions = {
|
||||
# Setup command logging to ~/.logs
|
||||
cmdlogger = {
|
||||
onEvent = "fish_preexec";
|
||||
body = ''
|
||||
mkdir -p ~/.logs
|
||||
echo (date -u +"%Y-%m-%dT%H:%M:%SZ")" "(echo %self)" "(pwd)": "$argv >> ~/.logs/(hostname)-(date "+%Y-%m-%d").log
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# Starship, for the prompt
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
directory = {
|
||||
truncation_length = 3;
|
||||
fish_style_pwd_dir_length = 1;
|
||||
};
|
||||
git_commit = {
|
||||
commit_hash_length = 6;
|
||||
only_detached = false;
|
||||
};
|
||||
package = {
|
||||
symbol = "";
|
||||
};
|
||||
time = {
|
||||
disabled = false;
|
||||
format = "[$time]($style)";
|
||||
time_format = "%I:%M %p";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
# Git configuration
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Nathan McCarty";
|
||||
userEmail = "nathan@mccarty.io";
|
||||
signing = {
|
||||
key = "B7A40A5D78C08885";
|
||||
signByDefault = true;
|
||||
};
|
||||
ignores = [
|
||||
"**/*~"
|
||||
"*~"
|
||||
"*_archive"
|
||||
"/auto/"
|
||||
"auto-save-list"
|
||||
".cask/"
|
||||
".dir-locals.el"
|
||||
"dist/"
|
||||
"**/.DS_Store"
|
||||
"*.elc"
|
||||
"/elpa/"
|
||||
"/.emacs.desktop"
|
||||
"/.emacs.desktop.lock"
|
||||
"/eshell/history"
|
||||
"/eshell/lastdir"
|
||||
"flycheck_*.el"
|
||||
"*_flymake.*"
|
||||
"/network-security.data"
|
||||
".org-id-locations"
|
||||
".persp"
|
||||
".projectile"
|
||||
"*.rel"
|
||||
"/server/"
|
||||
"tramp"
|
||||
"\\#*\\#"
|
||||
];
|
||||
delta.enable = true;
|
||||
extraConfig = {
|
||||
init = {
|
||||
defaultBranch = "trunk";
|
||||
};
|
||||
log = {
|
||||
showSignature = true;
|
||||
abbrevCommit = true;
|
||||
follow = true;
|
||||
decorate = false;
|
||||
};
|
||||
rerere = {
|
||||
enable = true;
|
||||
autoupdate = true;
|
||||
};
|
||||
merge = {
|
||||
ff = "only";
|
||||
conflictstyle = "diff3";
|
||||
};
|
||||
push = {
|
||||
default = "simple";
|
||||
followTags = true;
|
||||
};
|
||||
pull = {
|
||||
rebase = true;
|
||||
};
|
||||
status = {
|
||||
showUntrackedFiles = "all";
|
||||
};
|
||||
transfer = {
|
||||
fsckobjects = true;
|
||||
};
|
||||
color = {
|
||||
ui = "auto";
|
||||
};
|
||||
diff = {
|
||||
mnemonicPrefix = true;
|
||||
renames = true;
|
||||
wordRegex = ".";
|
||||
submodule = "log";
|
||||
};
|
||||
credential = {
|
||||
helper = "cache";
|
||||
};
|
||||
# Disable annoying safe directory nonsense
|
||||
safe = {
|
||||
directory = "*";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.ssh = {
|
||||
# SSH configuration
|
||||
enable = true;
|
||||
# extra config to set the ciphers
|
||||
extraConfig = ''
|
||||
Ciphers aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||
'';
|
||||
# enable session reuse
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
# Configure known hosts
|
||||
matchBlocks = {
|
||||
"levitation" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.12.134";
|
||||
};
|
||||
"perception" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.55.145";
|
||||
};
|
||||
"oracles" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.108.12";
|
||||
};
|
||||
"tounge" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.98.121";
|
||||
};
|
||||
"shadowchild" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.217.149";
|
||||
};
|
||||
"matrix.community.rs" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.129.209";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
202
home.nix
202
home.nix
|
@ -12,208 +12,6 @@
|
|||
shell = pkgs.fish;
|
||||
};
|
||||
};
|
||||
## Home manager proper
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
# Disable git "safe directories" for root
|
||||
# This is _highly_ cautioned against, but the feature breaks my workflow
|
||||
users.root = {
|
||||
programs.git = {
|
||||
extraConfig = {
|
||||
safe = {
|
||||
directory = "*";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
users.nathan = {
|
||||
programs.home-manager.enable = true;
|
||||
## Shell
|
||||
# Shell proper
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
# Setup our aliases
|
||||
shellAliases = {
|
||||
ls = "exa --icons";
|
||||
la = "exa --icons -a";
|
||||
lg = "exa --icons --git";
|
||||
cat = "bat";
|
||||
dig = "dog";
|
||||
df = "duf";
|
||||
};
|
||||
# Custom configuration
|
||||
interactiveShellInit = ''
|
||||
# Setup any-nix-shell
|
||||
any-nix-shell fish --info-right | source
|
||||
# Load logger function
|
||||
source ~/.config/fish/functions/cmdlogger.fish
|
||||
'';
|
||||
functions = {
|
||||
# Setup command logging to ~/.logs
|
||||
cmdlogger = {
|
||||
onEvent = "fish_preexec";
|
||||
body = ''
|
||||
mkdir -p ~/.logs
|
||||
echo (date -u +"%Y-%m-%dT%H:%M:%SZ")" "(echo %self)" "(pwd)": "$argv >> ~/.logs/(hostname)-(date "+%Y-%m-%d").log
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
# Starship, for the prompt
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
directory = {
|
||||
truncation_length = 3;
|
||||
fish_style_pwd_dir_length = 1;
|
||||
};
|
||||
git_commit = {
|
||||
commit_hash_length = 6;
|
||||
only_detached = false;
|
||||
};
|
||||
package = {
|
||||
symbol = "";
|
||||
};
|
||||
time = {
|
||||
disabled = false;
|
||||
format = "[$time]($style)";
|
||||
time_format = "%I:%M %p";
|
||||
};
|
||||
};
|
||||
};
|
||||
# Git configuration
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Nathan McCarty";
|
||||
userEmail = "nathan@mccarty.io";
|
||||
signing = {
|
||||
key = "B7A40A5D78C08885";
|
||||
signByDefault = true;
|
||||
};
|
||||
ignores = [
|
||||
"**/*~"
|
||||
"*~"
|
||||
"*_archive"
|
||||
"/auto/"
|
||||
"auto-save-list"
|
||||
".cask/"
|
||||
".dir-locals.el"
|
||||
"dist/"
|
||||
"**/.DS_Store"
|
||||
"*.elc"
|
||||
"/elpa/"
|
||||
"/.emacs.desktop"
|
||||
"/.emacs.desktop.lock"
|
||||
"/eshell/history"
|
||||
"/eshell/lastdir"
|
||||
"flycheck_*.el"
|
||||
"*_flymake.*"
|
||||
"/network-security.data"
|
||||
".org-id-locations"
|
||||
".persp"
|
||||
".projectile"
|
||||
"*.rel"
|
||||
"/server/"
|
||||
"tramp"
|
||||
"\\#*\\#"
|
||||
];
|
||||
delta.enable = true;
|
||||
extraConfig = {
|
||||
init = {
|
||||
defaultBranch = "trunk";
|
||||
};
|
||||
log = {
|
||||
showSignature = true;
|
||||
abbrevCommit = true;
|
||||
follow = true;
|
||||
decorate = false;
|
||||
};
|
||||
rerere = {
|
||||
enable = true;
|
||||
autoupdate = true;
|
||||
};
|
||||
merge = {
|
||||
ff = "only";
|
||||
conflictstyle = "diff3";
|
||||
};
|
||||
push = {
|
||||
default = "simple";
|
||||
followTags = true;
|
||||
};
|
||||
pull = {
|
||||
rebase = true;
|
||||
};
|
||||
status = {
|
||||
showUntrackedFiles = "all";
|
||||
};
|
||||
transfer = {
|
||||
fsckobjects = true;
|
||||
};
|
||||
color = {
|
||||
ui = "auto";
|
||||
};
|
||||
diff = {
|
||||
mnemonicPrefix = true;
|
||||
renames = true;
|
||||
wordRegex = ".";
|
||||
submodule = "log";
|
||||
};
|
||||
credential = {
|
||||
helper = "cache";
|
||||
};
|
||||
# Disable annoying safe directory nonsense
|
||||
safe = {
|
||||
directory = "*";
|
||||
};
|
||||
};
|
||||
};
|
||||
# SSH configuration
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
# extra config to set the ciphers
|
||||
extraConfig = ''
|
||||
Ciphers aes128-gcm@openssh.com,aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
||||
'';
|
||||
# enable session reuse
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
# Configure known hosts
|
||||
matchBlocks = {
|
||||
"levitation" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.12.134";
|
||||
};
|
||||
"perception" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.55.145";
|
||||
};
|
||||
"oracles" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.108.12";
|
||||
};
|
||||
"tounge" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.98.121";
|
||||
};
|
||||
"shadowchild" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.217.149";
|
||||
};
|
||||
"matrix.community.rs" = {
|
||||
forwardAgent = true;
|
||||
user = "nathan";
|
||||
hostname = "172.23.129.209";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
## Misc packages that were in user.nix
|
||||
# Install general use packages
|
||||
environment.systemPackages = with pkgs; [
|
||||
|
|
Loading…
Reference in New Issue