Compare commits
66 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
706e9ee95f | ||
|
|
2ebdda4ab4 | ||
|
|
be5a15f3d4 | ||
|
|
cc396c2daf | ||
|
|
1fe7f9b901 | ||
|
|
5f3d3a224a | ||
|
|
7eb20ee07d | ||
|
|
460f0d132d | ||
|
|
5d5b15fb63 | ||
|
|
92067f8b69 | ||
|
|
cc21dcdc92 | ||
|
|
ac9e58ede6 | ||
|
|
be57ba16dd | ||
|
|
2fd6a2c04a | ||
|
|
09e941abbd | ||
|
|
e21c901e94 | ||
|
|
ce738ae612 | ||
|
|
ddf5bcaeee | ||
|
|
f4e8b4083f | ||
|
|
3091004882 | ||
|
|
0d07e078aa | ||
|
|
d5a3520471 | ||
|
|
f586aba5b0 | ||
|
|
2120d3ba00 | ||
|
|
f2f1721e4c | ||
|
|
e000d5c7e8 | ||
|
|
82dfb95bde | ||
|
|
c94094a83d | ||
|
|
7fef2c9db2 | ||
|
|
dba3d0b44f | ||
|
|
e6a29ee61f | ||
|
|
5c1530ae46 | ||
|
|
7f5aea6a86 | ||
|
|
39a8b1455b | ||
|
|
0260f44582 | ||
|
|
e471c311c2 | ||
|
|
2b686288de | ||
|
|
26c3bef98f | ||
|
|
4f8af521a7 | ||
|
|
34affcba67 | ||
|
|
f53d460071 | ||
|
|
5b5548393b | ||
|
|
1701f5136e | ||
|
|
ed0e3658f9 | ||
|
|
773190f6c8 | ||
|
|
4f98e6a0e8 | ||
|
|
36e3d42ab7 | ||
|
|
874993c18c | ||
|
|
7c249ce8d7 | ||
|
|
95c3b2081d | ||
|
|
849b7bf3f7 | ||
|
|
ecfe33d30f | ||
|
|
87a27c824c | ||
|
|
1786f61e9a | ||
|
|
6dbbced319 | ||
|
|
62ac0320bf | ||
|
|
c8b8e04962 | ||
|
|
53005c1ba2 | ||
|
|
36a77a1d54 | ||
|
|
37ffa652f0 | ||
|
|
804b1e5723 | ||
|
|
7b315f9a39 | ||
|
|
9f873a95c0 | ||
|
|
db54cd95d9 | ||
|
|
f634eea3a7 | ||
|
|
ae071e4794 |
9
.sops.yaml
Normal file
9
.sops.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
keys:
|
||||||
|
- &john-p14s age1f6drjusg866yscj8029tk4yfpgecklrvezldm02ankm6h8nnwu5s2u6ahy
|
||||||
|
- &john-pc age1ykcs39e62pz3xu6cedg8ea685kv5d5qsrhgkndygzm8rx30xd5ys5t3qxt
|
||||||
|
creation_rules:
|
||||||
|
- path_regex: secrets.yaml$
|
||||||
|
key_groups:
|
||||||
|
- age:
|
||||||
|
- *john-p14s
|
||||||
|
- *john-pc
|
||||||
70
README.md
70
README.md
@@ -40,42 +40,54 @@ nhmu
|
|||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
description = "Home Manager configuration of john";
|
description = "John's system flake";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
home-manager = {
|
jsl-home = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "git+https://gitea.john-stream.com/john/jsl-home?ref=dev";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
john-home-config = {
|
|
||||||
url = "path:/home/john/home-manager";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
inputs.home-manager.follows = "home-manager";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = { self, nixpkgs, ... }@inputs:
|
||||||
{ nixpkgs, ... }@inputs:
|
let
|
||||||
let
|
system = "x86_64-linux";
|
||||||
system = "x86_64-linux";
|
nixosSystem = nixpkgs.lib.nixosSystem;
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
hostName = "john-p14s";
|
||||||
homeManagerConfiguration = inputs.home-manager.lib.homeManagerConfiguration;
|
in
|
||||||
jslDefault = inputs.john-home-config.homeManagerModules.default;
|
{
|
||||||
userName = "john";
|
nixosConfigurations.${hostName} = nixosSystem {
|
||||||
in
|
specialArgs =
|
||||||
{
|
{
|
||||||
homeConfigurations."${userName}" = homeManagerConfiguration {
|
inherit inputs;
|
||||||
inherit pkgs;
|
inherit system;
|
||||||
modules = [
|
|
||||||
jslDefault {
|
|
||||||
user = "${userName}";
|
|
||||||
# Add any additional configuration here
|
|
||||||
}
|
|
||||||
./home.nix
|
|
||||||
# Add other home manager modules here
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
modules = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
./configuration.nix
|
||||||
|
inputs.jsl-home.nixosModules.default
|
||||||
|
{
|
||||||
|
stateVersion = "24.05";
|
||||||
|
user = "john";
|
||||||
|
root = true;
|
||||||
|
ssh = true;
|
||||||
|
profile = "personal";
|
||||||
|
enableShell = true;
|
||||||
|
_1password = true;
|
||||||
|
docker = true;
|
||||||
|
graphical = {
|
||||||
|
steam = true;
|
||||||
|
vscode = true;
|
||||||
|
};
|
||||||
|
extraImports = [
|
||||||
|
./home-manager/john.nix
|
||||||
|
./home-manager/gnome.nix
|
||||||
|
./home-manager/ssh.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
79
flake.nix
79
flake.nix
@@ -8,6 +8,14 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
_1password-shell-plugins.url = "github:1Password/shell-plugins";
|
_1password-shell-plugins.url = "github:1Password/shell-plugins";
|
||||||
|
nixgl = {
|
||||||
|
url = "github:nix-community/nixGL";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
sops-nix = {
|
||||||
|
url = "github:Mic92/sops-nix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs = { self, nixpkgs, ... }@inputs:
|
||||||
@@ -16,53 +24,55 @@
|
|||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
|
||||||
|
# These will get applied to both the configured user and the root user (if enabled)
|
||||||
userOptions = config: {
|
userOptions = config: {
|
||||||
openssh.authorizedKeys.keyFiles = lib.optionals config.ssh [ ./personal_keys ];
|
openssh.authorizedKeys = lib.mkIf config.ssh (lib.mkMerge [
|
||||||
extraGroups = lib.optionals config.root [ "wheel" ];
|
(lib.mkIf (config.profile == "personal") { keyFiles = [ ./keys/personal ]; })
|
||||||
shell = lib.mkIf config.shell pkgs.zsh;
|
(lib.mkIf (config.profile == "work") { keyFiles = [ ./keys/work ]; })
|
||||||
|
]);
|
||||||
|
shell = lib.mkIf config.enableShell pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
homeManagerModules = config: [
|
mkhomeManagerModules = config: [
|
||||||
self.homeManagerModules.default {
|
(self.homeManagerModules.default inputs)
|
||||||
|
# { inherit (config) extraImports; }
|
||||||
|
{
|
||||||
user = config.user;
|
user = config.user;
|
||||||
stateVersion = config.stateVersion;
|
stateVersion = config.stateVersion;
|
||||||
profile = config.profile;
|
profile = config.profile;
|
||||||
shell = config.shell;
|
enableShell = config.enableShell;
|
||||||
ssh = config.ssh;
|
ssh = config.ssh;
|
||||||
_1password = config._1password;
|
_1password = config._1password;
|
||||||
|
docker = config.docker;
|
||||||
|
graphical = config.graphical;
|
||||||
}
|
}
|
||||||
] ++ config.extraImports;
|
] ++ config.extraImports;
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeManagerModules.default = { ... }: {
|
lib = { inherit mkhomeManagerModules; };
|
||||||
imports = [
|
|
||||||
./nixosModules/options.nix
|
homeManagerModules.default = inputs: {
|
||||||
./home.nix
|
imports = [ ./homeManagerModules ];
|
||||||
inputs._1password-shell-plugins.hmModules.default
|
|
||||||
];
|
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
|
||||||
"1password-cli"
|
|
||||||
];
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
(writeShellScriptBin "nhmu" ''
|
|
||||||
nix flake update --flake ~/.config/home-manager
|
|
||||||
nix run home-manager -- switch --flake ~/.config/home-manager
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.default = { config, ... }: {
|
nixosModules.default = { config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./nixosModules/options.nix
|
./nixosModules
|
||||||
./nixosModules/scripts.nix
|
|
||||||
inputs.home-manager.nixosModules.default
|
inputs.home-manager.nixosModules.default
|
||||||
];
|
];
|
||||||
nix.settings.trusted-users = [ "root" "@wheel" ];
|
nix.settings.trusted-users = [ "root" "@wheel" ];
|
||||||
users.users.${config.user} = {
|
users.users.${config.user} = lib.mkMerge [
|
||||||
isNormalUser = true;
|
{
|
||||||
} // userOptions config;
|
isNormalUser = true;
|
||||||
|
description = "John Lancaster";
|
||||||
|
extraGroups = []
|
||||||
|
++ lib.optional config.root "wheel"
|
||||||
|
++ lib.optional config.docker "docker"
|
||||||
|
++ lib.optional config.networking.networkmanager.enable "networkmanager";
|
||||||
|
}
|
||||||
|
(userOptions config)
|
||||||
|
];
|
||||||
|
|
||||||
users.users.root = lib.mkIf config.root (userOptions config);
|
users.users.root = lib.mkIf config.root (userOptions config);
|
||||||
security.sudo-rs = lib.mkIf config.root {
|
security.sudo-rs = lib.mkIf config.root {
|
||||||
@@ -72,19 +82,24 @@
|
|||||||
extraConfig = "Defaults timestamp_timeout=1440";
|
extraConfig = "Defaults timestamp_timeout=1440";
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zsh.enable = lib.mkIf config.shell true;
|
programs.zsh.enable = lib.mkIf config.enableShell true;
|
||||||
|
|
||||||
|
virtualisation.docker = lib.mkIf config.docker {
|
||||||
|
enable = true;
|
||||||
|
enableOnBoot = true;
|
||||||
|
package = pkgs.docker;
|
||||||
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
extraSpecialArgs = { inherit inputs; };
|
extraSpecialArgs = { inherit inputs; nixgl = inputs.nixgl; };
|
||||||
users = {
|
users = {
|
||||||
${config.user} = {
|
${config.user} = {
|
||||||
imports = homeManagerModules config;
|
imports = mkhomeManagerModules config;
|
||||||
};
|
};
|
||||||
} // lib.optionalAttrs config.root {
|
} // lib.optionalAttrs config.root {
|
||||||
root = {
|
root = {
|
||||||
# home.stateVersion = config.stateVersion;
|
imports = mkhomeManagerModules (config // { user = "root"; });
|
||||||
imports = homeManagerModules (config // { user = "root"; });
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,39 @@
|
|||||||
{ config, pkgs, lib, inputs, ... }:
|
{ inputs, config, pkgs, lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
# These modules are each responsible for responding appropriately to the options
|
||||||
imports = [
|
imports = [
|
||||||
./homeManagerModules/git.nix
|
./docker.nix
|
||||||
./homeManagerModules/shell.nix
|
./ghostty.nix
|
||||||
./homeManagerModules/ssh.nix
|
./git.nix
|
||||||
# inputs._1password-shell-plugins.hmModules.default
|
./shell.nix
|
||||||
|
./sops.nix
|
||||||
|
./ssh.nix
|
||||||
|
./vscode.nix
|
||||||
|
|
||||||
|
../nixosModules/options.nix
|
||||||
|
inputs._1password-shell-plugins.hmModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
|
||||||
|
"1password-cli"
|
||||||
|
"discord"
|
||||||
|
"spotify"
|
||||||
|
"steam"
|
||||||
|
"steam-original"
|
||||||
|
"steam-unwrapped"
|
||||||
|
"steam-run"
|
||||||
|
"sublimetext4"
|
||||||
|
"vscode"
|
||||||
|
"vscode-extension-mhutchie-git-graph"
|
||||||
|
"vscode-extension-ms-vscode-remote-vscode-remote-extensionpack"
|
||||||
|
"vscode-extension-MS-python-vscode-pylance"
|
||||||
|
"vscode-extension-github-copilot"
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"openssl-1.1.1w"
|
||||||
|
];
|
||||||
|
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = config.user;
|
home.username = config.user;
|
||||||
@@ -26,12 +53,20 @@
|
|||||||
lazygit
|
lazygit
|
||||||
btop
|
btop
|
||||||
yazi
|
yazi
|
||||||
|
uv
|
||||||
|
(writeShellScriptBin "nhmu" ''
|
||||||
|
nix flake update --flake ~/.config/home-manager
|
||||||
|
nix run home-manager -- switch --flake ~/.config/home-manager --impure
|
||||||
|
'')
|
||||||
# # It is sometimes useful to fine-tune packages, for example, by applying
|
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||||
# # overrides. You can do that directly here, just don't forget the
|
# # overrides. You can do that directly here, just don't forget the
|
||||||
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
||||||
# # fonts?
|
# # fonts?
|
||||||
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
||||||
];
|
]
|
||||||
|
++ lib.optional config.graphical.discord discord
|
||||||
|
++ lib.optional config.graphical.joplin joplin-desktop
|
||||||
|
++ lib.optional config.graphical.sublime sublime4;
|
||||||
|
|
||||||
# Home Manager can also manage your environment variables through
|
# Home Manager can also manage your environment variables through
|
||||||
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
# 'home.sessionVariables'. These will be explicitly sourced when using a
|
||||||
@@ -72,4 +107,4 @@
|
|||||||
vault = "Private"
|
vault = "Private"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
11
homeManagerModules/docker.nix
Normal file
11
homeManagerModules/docker.nix
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
home.packages = lib.mkIf config.docker (with pkgs; [
|
||||||
|
docker
|
||||||
|
docker-compose
|
||||||
|
lazydocker
|
||||||
|
(pkgs.writeShellScriptBin "test-docker" ''
|
||||||
|
echo "Hello from docker.nix!"
|
||||||
|
'')
|
||||||
|
]);
|
||||||
|
}
|
||||||
115
homeManagerModules/ghostty.nix
Normal file
115
homeManagerModules/ghostty.nix
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
{ config, pkgs, lib, nixgl, ... }:
|
||||||
|
{
|
||||||
|
home.sessionVariables = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||||
|
TERMINAL = "ghostty";
|
||||||
|
};
|
||||||
|
|
||||||
|
# nixGL is now provided as a flake input
|
||||||
|
nixGL.packages = nixgl.packages.${pkgs.system};
|
||||||
|
nixGL.defaultWrapper = "mesa";
|
||||||
|
nixGL.installScripts = [ "mesa" ];
|
||||||
|
|
||||||
|
programs.ghostty = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
package = config.lib.nixGL.wrap pkgs.ghostty;
|
||||||
|
settings = {
|
||||||
|
# command = "TERM=xterm-256color /usr/bin/bash";
|
||||||
|
font-size = 12;
|
||||||
|
font-family = "Source Code Pro";
|
||||||
|
# theme = "idleToes";
|
||||||
|
# theme = "CGA";
|
||||||
|
theme = "catppuccin-mocha";
|
||||||
|
# theme = "CobaltNext";
|
||||||
|
# clipboard-read = "allow";
|
||||||
|
copy-on-select = true;
|
||||||
|
shell-integration = "zsh";
|
||||||
|
shell-integration-features = [ "no-title" "sudo" ];
|
||||||
|
gtk-single-instance = true;
|
||||||
|
|
||||||
|
window-padding-balance = true ;
|
||||||
|
window-padding-x = 5;
|
||||||
|
window-padding-y = 5;
|
||||||
|
initial-window = true;
|
||||||
|
resize-overlay = "never";
|
||||||
|
|
||||||
|
# Example: https://gist.github.com/adibhanna/c552c452fb244b3b721e3c2432e85cde
|
||||||
|
keybind = [
|
||||||
|
"ctrl+s>n=new_split:down"
|
||||||
|
"ctrl+t>n=new_tab"
|
||||||
|
"ctrl+t>1=goto_tab:1"
|
||||||
|
"ctrl+t>2=goto_tab:2"
|
||||||
|
"ctrl+t>3=goto_tab:3"
|
||||||
|
"ctrl+s>i=goto_split:up"
|
||||||
|
"ctrl+s>k=goto_split:down"
|
||||||
|
];
|
||||||
|
|
||||||
|
# window-position-x = 500;
|
||||||
|
# window-position-y = 500;
|
||||||
|
window-height = 40;
|
||||||
|
window-width = 200;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://github.com/ghostty-org/ghostty/discussions/3763#discussioncomment-11699970
|
||||||
|
xdg.desktopEntries."com.mitchellh.ghostty" = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||||
|
name = "Ghostty";
|
||||||
|
type = "Application";
|
||||||
|
comment = "A terminal emulator";
|
||||||
|
exec = "ghostty";
|
||||||
|
icon = "com.mitchellh.ghostty";
|
||||||
|
terminal = false;
|
||||||
|
startupNotify = true;
|
||||||
|
categories = [ "System" "TerminalEmulator" ];
|
||||||
|
settings = {
|
||||||
|
Keywords = "terminal;tty;pty;";
|
||||||
|
X-GNOME-UsesNotifications = "true";
|
||||||
|
X-TerminalArgExec = "-e";
|
||||||
|
X-TerminalArgTitle = "--title=";
|
||||||
|
X-TerminalArgAppId = "--class=";
|
||||||
|
X-TerminalArgDir = "--working-directory=";
|
||||||
|
X-TerminalArgHold = "--wait-after-command";
|
||||||
|
};
|
||||||
|
actions = {
|
||||||
|
new-window = {
|
||||||
|
name = "New Window";
|
||||||
|
exec = "ghostty";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://discourse.nixos.org/t/apps-installed-via-home-manager-are-not-visible-within-gnome/48252/2
|
||||||
|
# home.activation.copyDesktopFiles = lib.hm.dag.entryAfter ["installPackages"] ''
|
||||||
|
# if [ "$XDG_CURRENT_DESKTOP" = "GNOME" ]; then
|
||||||
|
|
||||||
|
# mkdir -p "${config.home.homeDirectory}/.local/share/applications"
|
||||||
|
|
||||||
|
# if [ -d "${config.home.homeDirectory}/.local/share/applications/nix" ]; then
|
||||||
|
# rm -rf "${config.home.homeDirectory}/.local/share/applications/nix"
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# ln -sf "${config.home.homeDirectory}/.nix-profile/share/applications" \
|
||||||
|
# ${config.home.homeDirectory}/.local/share/applications/nix
|
||||||
|
|
||||||
|
# mkdir -p "${config.home.homeDirectory}/.local/share/icons"
|
||||||
|
|
||||||
|
# if [ -d "${config.home.homeDirectory}/.local/share/icons/nix" ]; then
|
||||||
|
# rm -rf "${config.home.homeDirectory}/.local/share/icons/nix"
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# ln -sf "${config.home.homeDirectory}/.nix-profile/share/icons" \
|
||||||
|
# ${config.home.homeDirectory}/.local/share/icons/nix
|
||||||
|
|
||||||
|
# fi
|
||||||
|
# '';
|
||||||
|
|
||||||
|
# https://wiki.nixos.org/wiki/GNOME
|
||||||
|
# https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/#setting-gnome-options
|
||||||
|
# dconf.settings = {
|
||||||
|
# "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = {
|
||||||
|
# "binding" = "<Super>Return";
|
||||||
|
# "command" = "ghostty";
|
||||||
|
# "name" = "Terminal";
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
}
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
echo "Hello from ~/.config/home-manager/home.nix!"
|
echo "Hello from ~/.config/home-manager/home.nix!"
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
programs.zsh = lib.mkIf config.shell {
|
programs.zsh = lib.mkIf config.enableShell {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
autosuggestion.enable = true;
|
autosuggestion.enable = true;
|
||||||
@@ -38,7 +38,9 @@
|
|||||||
};
|
};
|
||||||
shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
|
shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
|
||||||
initContent = lib.mkIf config._1password ''
|
initContent = lib.mkIf config._1password ''
|
||||||
source ${config.home.homeDirectory}/.config/op/plugins.sh
|
if [ -f "${config.home.homeDirectory}/.config/op/plugins.sh" ]; then
|
||||||
|
source ${config.home.homeDirectory}/.config/op/plugins.sh
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
24
homeManagerModules/sops.nix
Normal file
24
homeManagerModules/sops.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{ inputs, config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
sopsConfigPath = "${config.home.homeDirectory}/.config/home-manager/jsl-home/.sops.yaml";
|
||||||
|
sopsSecretsPath = "${config.home.homeDirectory}/.config/home-manager/jsl-home/keys/secrets.yaml";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
|
];
|
||||||
|
sops = {
|
||||||
|
# It's also possible to use a ssh key, but only when it has no password:
|
||||||
|
age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
|
||||||
|
defaultSopsFile = ../keys/secrets.yaml;
|
||||||
|
defaultSopsFormat = "yaml";
|
||||||
|
};
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
(writeShellScriptBin "edit-secrets" ''
|
||||||
|
sops --config ${sopsConfigPath} ${sopsSecretsPath}
|
||||||
|
'')
|
||||||
|
sops
|
||||||
|
age
|
||||||
|
];
|
||||||
|
programs.zsh.shellAliases.sops = lib.mkIf config.enableShell "sops --config ${sopsConfigPath}";
|
||||||
|
}
|
||||||
19
homeManagerModules/vscode.nix
Normal file
19
homeManagerModules/vscode.nix
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.vscode = lib.mkIf config.graphical.vscode {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.vscode;
|
||||||
|
profiles.default.extensions = with pkgs.vscode-extensions; [
|
||||||
|
mhutchie.git-graph
|
||||||
|
ms-vscode-remote.vscode-remote-extensionpack
|
||||||
|
ms-python.python
|
||||||
|
ms-python.vscode-pylance
|
||||||
|
ms-toolsai.jupyter
|
||||||
|
charliermarsh.ruff
|
||||||
|
github.vscode-pull-request-github
|
||||||
|
github.vscode-github-actions
|
||||||
|
github.copilot
|
||||||
|
catppuccin.catppuccin-vsc
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
34
keys/secrets.yaml
Normal file
34
keys/secrets.yaml
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
hello: ENC[AES256_GCM,data:4uC3/Tig8jP77fzue3w/gevs7yj61h3hF8bEMLPBlJakpna3G8DVAFOlyqEjOg==,iv:3LCkLVdAdMdo9cD/1usIYu/akZ5anpMlqciHrVcwOLU=,tag:sOSoPPxoippFJAusbtIuVQ==,type:str]
|
||||||
|
example_key: ENC[AES256_GCM,data:cLLYEiJbKg60ANK/h+kG,iv:1yrJt5JhbDP/9/Wb2l93fjwQF1hxERnxjPZ6qF4S/Bw=,tag:wbboaGylFJRSj4/TB+RCZg==,type:str]
|
||||||
|
#ENC[AES256_GCM,data:c0Ay18GCW/gowNHmF67TMg==,iv:T+FN8xaVilVSETMQztl6lmpLqnGiyrXhJvWsO+dBdd0=,tag:1D6TkngB116dOeCAX85djg==,type:comment]
|
||||||
|
example_array:
|
||||||
|
- ENC[AES256_GCM,data:yUJ7p5VfyQUANjbuz48=,iv:XTGb97tMV3mkPwNyKetSflLLlE31g9UgMPcelMPpNZ0=,tag:j5muB72Ogc/gtenvsWvpbQ==,type:str]
|
||||||
|
- ENC[AES256_GCM,data:8eQ2clCNBxPfdycPMOo=,iv:C9iT+wJH9ENJShNYo3IGceRwHyrlU6LUE7jpc+72KOw=,tag:YTbZqYJVMUoTRqD2ujTOvg==,type:str]
|
||||||
|
example_number: ENC[AES256_GCM,data:LhABh/RtBsdKAg==,iv:JGYFnixDNZUIRKJcuaenvO8D60T+Jvx/R7SWxbIPXsM=,tag:+1b/aj3x1yfQZ2j4OM5dcg==,type:float]
|
||||||
|
example_booleans:
|
||||||
|
- ENC[AES256_GCM,data:pGnelw==,iv:KAayJZ8px4Qupv0NfapSQ6valrVKndEtCb3U4MTmK/U=,tag:lkl+zBgkEMbFQjNssxYQjg==,type:bool]
|
||||||
|
- ENC[AES256_GCM,data:Vqqfp2w=,iv:SC1DS7G9/lHYtA6PPRbVsi/ZhyNUYvRjXxHIqCxqEPA=,tag:9hv6F1rP7xSd08KCKkuiLQ==,type:bool]
|
||||||
|
sops:
|
||||||
|
age:
|
||||||
|
- recipient: age1f6drjusg866yscj8029tk4yfpgecklrvezldm02ankm6h8nnwu5s2u6ahy
|
||||||
|
enc: |
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBoWkxDSnlNT2Vua1ZXWC8r
|
||||||
|
SU9UMnhaVXVEVlZGL3dtYTBJSzNGbHVaSTJNCm9ZTFM3RndpRktUcWhwZk1Fc2dk
|
||||||
|
ZGtoWXdoOWVyK1F0YStSS3dsMkg2R28KLS0tIFkrdVFZNlVxRjhPaWdMZXl2elV3
|
||||||
|
TVpyTzFsNFNmd3FNU0tlMnlTOHNTQWsKfKdN4epZokF74bCNr9+jxulZJFBQM83P
|
||||||
|
quMhl+H85My8jAsEeC9CW7y2jdNPJkfk9gHun4ozoW8U7o6y5RLfJg==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
- recipient: age1ykcs39e62pz3xu6cedg8ea685kv5d5qsrhgkndygzm8rx30xd5ys5t3qxt
|
||||||
|
enc: |
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBSakZRUnkraWtId2h3eUhB
|
||||||
|
REpkUHhYMm1MSmtFU2pvd1BpQ0xRTTlCWkZJCkxrTm1sdDBqclJ3RHR6VkllOFpo
|
||||||
|
ZXRtS2lsazRDS2lyRnZmT3FTTjJ6WUUKLS0tIExxNlFoeDhHQ3l5a1VvUHNRWUdw
|
||||||
|
Mms2UEhFSU82UWR5Z1VvU25qenJUQm8KtQeZDIfJIczm1l8ql/WmVEf8KI9dg0vw
|
||||||
|
9rNSjtBkEttVd21zUSOziG4513abllE8NFTkAc1z3HacuXpHTBnd5A==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
||||||
|
lastmodified: "2025-07-07T06:14:57Z"
|
||||||
|
mac: ENC[AES256_GCM,data:gqadQL2Qp31+3ATZa0r4LDVNv8txUBoRsj3nZnBdLXkyMXKUQD9kuPOS1j+/vF5bg1d6rVdQAWl8BKlcu7UyyhO95P3G4l7hxdNBQCuNbiyb0hxrR2G7O1ZpMGuKec7+cBRkpGtVMrPmvt/7Ymh27qXiV9Gx6j812iSlORolj3w=,iv:Fg23U8c5IRWLdy2KmLHK3O+O9P1P58JF1jqzKnM4wLY=,tag:n6mBBzxQ/hjh5yREwyVGkg==,type:str]
|
||||||
|
unencrypted_suffix: _unencrypted
|
||||||
|
version: 3.10.2
|
||||||
8
nixosModules/default.nix
Normal file
8
nixosModules/default.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{ inputs, config, pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./options.nix
|
||||||
|
./scripts.nix
|
||||||
|
./steam.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
description = "Whether enable all the root user stuff";
|
description = "Whether enable all the root user stuff";
|
||||||
};
|
};
|
||||||
|
|
||||||
options.shell = lib.mkOption {
|
options.enableShell = lib.mkOption {
|
||||||
type = lib.types.bool;
|
type = lib.types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Whether to enable all the zsh stuff";
|
description = "Whether to enable all the zsh stuff";
|
||||||
@@ -53,4 +53,26 @@
|
|||||||
default = [];
|
default = [];
|
||||||
description = "Additional Home Manager modules to import";
|
description = "Additional Home Manager modules to import";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
options.docker = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to enable docker stuff";
|
||||||
|
};
|
||||||
|
|
||||||
|
options.graphical =
|
||||||
|
let
|
||||||
|
boolOption = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
discord = boolOption;
|
||||||
|
ghostty = boolOption;
|
||||||
|
joplin = boolOption;
|
||||||
|
steam = boolOption;
|
||||||
|
sublime = boolOption;
|
||||||
|
vscode = boolOption;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ in
|
|||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(pkgs.writeShellScriptBin "nfs" ''
|
(pkgs.writeShellScriptBin "nfs" ''
|
||||||
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${hostName} --impure
|
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${hostName} --impure
|
||||||
'')
|
'')
|
||||||
(pkgs.writeShellScriptBin "nfsu" ''
|
(pkgs.writeShellScriptBin "nfsu" ''
|
||||||
FLAKE=$(readlink -f /etc/nixos)
|
FLAKE=$(readlink -f /etc/nixos)
|
||||||
nix flake update --flake $FLAKE --impure
|
nix flake update --flake $FLAKE --impure
|
||||||
sudo nixos-rebuild switch --flake $FLAKE#${hostName} --impure
|
sudo nixos-rebuild switch --flake $FLAKE#${hostName} --impure
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
10
nixosModules/steam.nix
Normal file
10
nixosModules/steam.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
programs.steam = lib.mkIf config.graphical.steam {
|
||||||
|
enable = true;
|
||||||
|
gamescopeSession.enable = true;
|
||||||
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||||
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||||
|
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user