87 Commits

Author SHA1 Message Date
John Lancaster
f4e8b4083f nixgl flake input attempt 2025-07-06 15:42:02 -05:00
John Lancaster
3091004882 made desktopEntries optional 2025-07-06 12:40:28 -05:00
John Lancaster
0d07e078aa disabled some gnome stuff 2025-07-06 12:32:32 -05:00
John Lancaster
d5a3520471 more ghostty stuff 2025-07-06 12:27:51 -05:00
John Lancaster
f586aba5b0 attempting ghostty wrapper 2025-07-06 12:18:59 -05:00
John Lancaster
2120d3ba00 typo 2025-07-06 11:40:00 -05:00
John Lancaster
f2f1721e4c changed import style 2025-07-06 11:39:27 -05:00
John Lancaster
e000d5c7e8 shortened 2025-07-04 10:57:30 -05:00
John Lancaster
82dfb95bde moved logic for default home manager 2025-07-04 10:55:46 -05:00
John Lancaster
c94094a83d created default for nixos modules 2025-07-04 10:52:49 -05:00
John Lancaster
7fef2c9db2 moved steam to nixosModules 2025-07-04 10:50:27 -05:00
John Lancaster
dba3d0b44f moved options 2025-07-04 10:47:50 -05:00
John Lancaster
e6a29ee61f typo 2025-07-04 10:46:41 -05:00
John Lancaster
5c1530ae46 fixed inputs 2025-07-04 10:46:08 -05:00
John Lancaster
7f5aea6a86 moved home.nix into default.nix 2025-07-04 10:44:40 -05:00
John Lancaster
39a8b1455b added steam module 2025-07-04 10:26:43 -05:00
John Lancaster
0260f44582 added sops 2025-07-04 01:40:55 -05:00
John Lancaster
e471c311c2 permittedInsecurePackages 2025-07-04 01:28:54 -05:00
John Lancaster
2b686288de more allowUnfreePredicate 2025-07-04 01:27:01 -05:00
John Lancaster
26c3bef98f more allowUnfreePredicate 2025-07-04 01:26:28 -05:00
John Lancaster
4f8af521a7 more allowUnfreePredicate 2025-07-04 01:25:52 -05:00
John Lancaster
34affcba67 more allowUnfreePredicate 2025-07-04 01:23:29 -05:00
John Lancaster
f53d460071 more allowUnfreePredicate 2025-07-04 01:22:56 -05:00
John Lancaster
5b5548393b more allowUnfreePredicate 2025-07-04 01:22:30 -05:00
John Lancaster
1701f5136e more allowUnfreePredicate 2025-07-04 01:22:03 -05:00
John Lancaster
ed0e3658f9 added unfree 2025-07-04 01:21:13 -05:00
John Lancaster
773190f6c8 added vscode module 2025-07-04 01:11:18 -05:00
John Lancaster
4f98e6a0e8 logical and fix 2025-07-04 00:59:00 -05:00
John Lancaster
36e3d42ab7 added ghostty module 2025-07-04 00:57:44 -05:00
John Lancaster
874993c18c revert 2025-07-04 00:04:30 -05:00
John Lancaster
7c249ce8d7 pruning 2025-07-04 00:01:09 -05:00
John Lancaster
95c3b2081d another attempt 2025-07-03 23:58:08 -05:00
John Lancaster
849b7bf3f7 consolidated options? 2025-07-03 23:54:55 -05:00
John Lancaster
ecfe33d30f passing thru docker option 2025-07-03 23:39:27 -05:00
John Lancaster
87a27c824c typo 2025-07-03 23:36:58 -05:00
John Lancaster
1786f61e9a fixed option? 2025-07-03 23:36:16 -05:00
John Lancaster
6dbbced319 removed optionality for testing 2025-07-03 23:34:19 -05:00
John Lancaster
62ac0320bf added test script 2025-07-03 23:32:01 -05:00
John Lancaster
c8b8e04962 formatting 2025-07-03 23:31:54 -05:00
John Lancaster
53005c1ba2 fixes 2025-07-03 23:27:31 -05:00
John Lancaster
36a77a1d54 added more docker packages 2025-07-03 23:26:00 -05:00
John Lancaster
37ffa652f0 name fix 2025-07-03 23:19:44 -05:00
John Lancaster
804b1e5723 added docker option 2025-07-03 23:17:56 -05:00
John Lancaster
7b315f9a39 fix 2025-07-03 22:09:24 -05:00
John Lancaster
9f873a95c0 moved over other user options for nixosModule 2025-07-03 22:08:06 -05:00
John Lancaster
db54cd95d9 name fix 2025-07-03 21:54:34 -05:00
John Lancaster
f634eea3a7 rename 2025-07-03 21:50:32 -05:00
John Lancaster
ae071e4794 renamed to mkhomeManagerModules 2025-07-03 21:37:07 -05:00
John Lancaster
16bdff2d69 forcing root user name 2025-07-03 18:06:16 -05:00
John Lancaster
6094dd062d added options to root 2025-07-03 17:51:20 -05:00
John Lancaster
0d0a4b2429 importing git.nix in root now 2025-07-03 01:42:05 -05:00
John Lancaster
de44f365fb shuffled root user options 2025-07-03 00:27:12 -05:00
John Lancaster
7220d8eed2 fix 2025-07-03 00:24:53 -05:00
John Lancaster
322d4ee482 fix 2025-07-03 00:24:27 -05:00
John Lancaster
74a399b8da added stateVersion for root user 2025-07-03 00:23:07 -05:00
John Lancaster
d0040bf42e added eza to ignore list 2025-07-03 05:08:35 +00:00
John Lancaster
4f7d24e8a7 added root credential store 2025-07-03 05:08:24 +00:00
John Lancaster
6fec75538f no longer using global packages 2025-07-03 04:48:31 +00:00
John Lancaster
8736ef6520 theme switch 2025-07-03 04:45:26 +00:00
John Lancaster
b3b27c5b56 history options 2025-07-03 04:36:11 +00:00
John Lancaster
1d0c88a021 added root option 2025-07-03 04:24:54 +00:00
John Lancaster
0db404fd58 moved nhmu 2025-07-02 23:04:32 -05:00
John Lancaster
c1a9e401cb broke out ssh module 2025-07-02 22:56:10 -05:00
97b2e05f80 added root-ish options 2025-07-03 03:40:34 +00:00
7ddbba1b85 added zsh program enable 2025-07-03 03:33:23 +00:00
a8655471ee added root user options 2025-07-03 03:29:20 +00:00
b7aa2be8e7 started users stuff 2025-07-03 03:00:21 +00:00
John Lancaster
e2fa10ae0d restructured 2025-07-02 17:58:30 -05:00
John Lancaster
aa6e9a515f more options passed thru 2025-07-01 23:46:23 -05:00
John Lancaster
8b48ed06e2 working-ish, not all options 2025-07-01 23:16:12 -05:00
John Lancaster
9b4f75126e removed default state version 2025-07-01 17:40:10 -05:00
John Lancaster
8ff937f722 different pass thru 2025-07-01 17:38:52 -05:00
John Lancaster
d56d7ac9cd better pass thru 2025-07-01 17:36:51 -05:00
John Lancaster
ee597577d4 testing fake stateVersion 2025-07-01 17:34:32 -05:00
John Lancaster
6b78ef3a71 state version pass thru option 2025-07-01 17:33:15 -05:00
John Lancaster
6fd8ceead7 input fix 2025-07-01 17:29:24 -05:00
John Lancaster
537cda3889 self input 2025-07-01 17:28:09 -05:00
John Lancaster
0c7d55488b syntax fix 2025-07-01 17:27:25 -05:00
John Lancaster
4c3f14b4ab started nixos module 2025-07-01 17:18:00 -05:00
John Lancaster
1ae16e2971 fixed 2025-07-01 17:10:46 -05:00
John Lancaster
ee1f038f55 vault config 2025-06-30 23:31:34 -05:00
John Lancaster
6afd99827c 1password options 2025-06-30 23:21:22 -05:00
John Lancaster
57d59a9dea options 2025-06-30 22:45:04 -05:00
John Lancaster
c954124c13 added shell stuff 2025-06-30 20:21:20 -05:00
John Lancaster
f829f82885 profile option finally working 2025-06-30 19:44:19 -05:00
John Lancaster
8900ac44f0 working without option, but still referenced 2025-06-30 19:34:45 -05:00
John Lancaster
bb145deb8e stripped down 2025-06-30 19:21:35 -05:00
15 changed files with 542 additions and 117 deletions

101
flake.nix
View File

@@ -2,53 +2,96 @@
description = "Home Manager configuration flake for JSL";
inputs = {
# Specify the source of Home Manager and Nixpkgs.
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
_1password-shell-plugins.url = "github:1Password/shell-plugins";
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }:
outputs = { self, nixpkgs, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
homeManagerModule = { config, pkgs, ... }: {
options.user = lib.mkOption {
type = lib.types.str;
description = "The username for the Home Manager configuration.";
# These will get applied to both the configured user and the root user (if enabled)
userOptions = config: {
openssh.authorizedKeys.keyFiles = lib.optionals config.ssh [ ./personal_keys ];
shell = lib.mkIf config.enableShell pkgs.zsh;
};
options.profile = lib.mkOption {
type = lib.types.enum [ "personal" "work" ];
default = "personal";
description = "Profile type for the Home Manager configuration.";
};
mkhomeManagerModules = config: [
self.homeManagerModules.default
# { inherit (config) extraImports; }
{
user = config.user;
stateVersion = config.stateVersion;
profile = config.profile;
enableShell = config.enableShell;
ssh = config.ssh;
_1password = config._1password;
docker = config.docker;
graphical = config.graphical;
steam = config.steam;
}
] ++ config.extraImports;
imports = [ ./home.nix ];
};
# Function to create a home configuration for any user
mkHomeConfiguration = username: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ homeManagerModule { user = username; } ];
};
# Default username from the module evaluation
evaluatedOptions = lib.evalModules { modules = [ homeManagerModule ]; };
userName = evaluatedOptions.config.user;
in
{
# Default configuration using the default username
homeConfigurations.${userName} = mkHomeConfiguration userName;
lib = { inherit mkhomeManagerModules; };
# Export the function so other flakes can create configurations for any user
lib.mkHomeConfiguration = mkHomeConfiguration;
homeManagerModules.default = { ... }: { imports = [ ./homeManagerModules ]; };
# Export modules for reuse in other flakes
homeManagerModules.default = homeManagerModule;
nixosModules.default = { config, ... }: {
imports = [
./nixosModules
inputs.home-manager.nixosModules.default
];
nix.settings.trusted-users = [ "root" "@wheel" ];
users.users.${config.user} = {
isNormalUser = true;
description = "John Lancaster";
extraGroups = []
++ lib.optionals config.root [ "wheel" ]
++ lib.optionals config.docker [ "docker" ]
++ lib.optionals config.networking.networkmanager.enable [ "networkmanager" ];
} // userOptions config;
users.users.root = lib.mkIf config.root (userOptions config);
security.sudo-rs = lib.mkIf config.root {
enable = true;
execWheelOnly = false;
wheelNeedsPassword = false;
extraConfig = "Defaults timestamp_timeout=1440";
};
programs.zsh.enable = lib.mkIf config.enableShell true;
virtualisation.docker = lib.mkIf config.docker {
enable = true;
enableOnBoot = true;
package = pkgs.docker;
};
home-manager = {
useUserPackages = true;
extraSpecialArgs = { inherit inputs; nixgl = inputs.nixgl; };
users = {
${config.user} = {
imports = mkhomeManagerModules config;
};
} // lib.optionalAttrs config.root {
root = {
imports = mkhomeManagerModules (config // { user = "root"; });
};
};
};
};
};
}

View File

@@ -1,85 +0,0 @@
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the paths it should
# manage.
home.username = config.user;
home.homeDirectory = "/home/${config.user}";
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
home.stateVersion = "25.05"; # Please read the comment before changing.
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
# # Adds the 'hello' command to your environment. It prints a friendly
# # "Hello, world!" when run.
# pkgs.hello
uv
git
eza
(writeShellScriptBin "nhmu" ''
nix flake update --flake ~/.config/home-manager
nix run home-manager -- switch --flake ~/.config/home-manager
'')
# # It is sometimes useful to fine-tune packages, for example, by applying
# # 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
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
# # You can also create simple shell scripts directly inside your
# # configuration. For example, this adds a command 'my-hello' to your
# # environment:
# (pkgs.writeShellScriptBin "my-hello" ''
# echo "Hello, ${config.home.username}!"
# '')
];
# Home Manager is pretty good at managing dotfiles. The primary way to manage
# plain files is through 'home.file'.
home.file = {
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
# # symlink to the Nix store copy.
# ".screenrc".source = dotfiles/screenrc;
# # You can also set the file content immediately.
# ".gradle/gradle.properties".text = ''
# org.gradle.console=verbose
# org.gradle.daemon.idletimeout=3600000
# '';
};
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/john/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# programs.ssh.enable = true;
}

View File

@@ -0,0 +1,114 @@
{ inputs, config, pkgs, lib, ... }:
{
# These modules are each responsible for responding appropriately to the options
imports = [
./docker.nix
./ghostty.nix
./git.nix
./shell.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
# manage.
home.username = config.user;
home.homeDirectory = lib.mkIf (config.user != "root") "/home/${config.user}";
home.stateVersion = config.stateVersion;
# The home.packages option allows you to install Nix packages into your
# environment.
home.packages = with pkgs; [
wget
curl
cacert
busybox
gnugrep
dig
gdu
lazygit
btop
yazi
sops
(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
# # 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
# # fonts?
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
] ++ lib.optionals config.graphical [
discord
spotify
sublime4
joplin-desktop
] ++ lib.optionals config._1password [
_1password-cli
gh # GitHub CLI with 1Password integration
];
# Home Manager can also manage your environment variables through
# 'home.sessionVariables'. These will be explicitly sourced when using a
# shell provided by Home Manager. If you don't want to manage your shell
# through Home Manager then you have to manually source 'hm-session-vars.sh'
# located at either
#
# ~/.nix-profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh
#
# or
#
# /etc/profiles/per-user/john/etc/profile.d/hm-session-vars.sh
#
home.sessionVariables = {
# EDITOR = "emacs";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# https://developer.1password.com/docs/cli/shell-plugins/nix/
programs._1password-shell-plugins = lib.mkIf config._1password {
# enable 1Password shell plugins for bash, zsh, and fish shell
enable = true;
# the specified packages as well as 1Password CLI will be
# automatically installed and configured to use shell plugins
# https://developer.1password.com/docs/cli/shell-plugins
plugins = with pkgs; [ gh ];
};
home.file.".config/1Password/ssh/agent.toml" = lib.mkIf config._1password {
# https://developer.1password.com/docs/ssh/agent/config
text = ''
[[ssh-keys]]
vault = "Private"
'';
};
}

View 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!"
'')
]);
}

View File

@@ -0,0 +1,115 @@
{ config, pkgs, lib, nixgl, ... }:
{
home.sessionVariables = lib.mkIf (config.enableShell && config.graphical) {
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) {
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) {
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";
# };
# };
}

View File

@@ -0,0 +1,21 @@
{ config, lib, ... }:
{
programs.git = lib.mkMerge [
{
enable = true;
extraConfig = {
credential.helper = "store --file ~/.git-credentials";
init.defaultBranch = "main";
push.autoSetupRemote = true;
};
}
(lib.mkIf (config.profile == "personal") {
userName = "John Lancaster";
userEmail = "32917998+jsl12@users.noreply.github.com";
})
(lib.mkIf (config.profile == "work") {
userName = "John Lancaster";
userEmail = "john.lancaster@crowncastle.com";
})
];
}

View File

@@ -0,0 +1,44 @@
{ config, pkgs, lib, inputs, ... }:
{
home.packages = with pkgs; [
eza
(writeShellScriptBin "test-pkgs" ''
echo "Hello from ~/.config/home-manager/home.nix!"
'')
];
programs.zsh = lib.mkIf config.enableShell {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
# syntaxHighlighting.enable = true;
history = {
append = true;
ignoreAllDups = true;
ignorePatterns = [
"history"
"ls"
"eza"
"clear"
];
save = 1000;
size = 1000;
share = true;
};
oh-my-zsh = {
enable = true;
# theme = "risto";
theme = "agnoster";
plugins = [
"sudo"
"dotenv"
"git"
"ssh"
"ssh-agent"
] ++ lib.optional config._1password "1password";
};
shellAliases.ls = "${pkgs.eza}/bin/eza -lgos type --no-time";
initContent = lib.mkIf config._1password ''
source ${config.home.homeDirectory}/.config/op/plugins.sh
'';
};
}

View File

@@ -0,0 +1,32 @@
{ config, lib, ... }:
{
programs.ssh = lib.mkIf config.ssh {
enable = true;
extraConfig = ''
SetEnv TERM="xterm-256color"
${lib.optionalString config._1password "IdentityAgent ~/.1password/agent.sock"}
'';
matchBlocks = lib.mkMerge [
(lib.mkIf (config.profile == "personal") {
"panoptes" = {
hostname = "192.168.1.107";
user = "panoptes";
};
"pve5070" = {
hostname = "192.168.1.130";
user = "root";
};
"nix-test" = {
hostname = "192.168.1.36";
user = "john";
};
})
(lib.mkIf (config.profile == "work") {
"ubuntu-nvidia" = {
hostname = "10.118.46.120";
user = "john";
};
})
];
};
}

View File

@@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
{
programs.vscode = lib.mkIf config.graphical {
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
];
};
}

8
nixosModules/default.nix Normal file
View File

@@ -0,0 +1,8 @@
{ inputs, config, pkgs, lib, ... }:
{
imports = [
./options.nix
./scripts.nix
./steam.nix
];
}

74
nixosModules/options.nix Normal file
View File

@@ -0,0 +1,74 @@
{ lib, ... }:
{
options.user = lib.mkOption {
type = lib.types.str;
description = "The username for the Home Manager configuration.";
};
# This value determines the Home Manager release that your configuration is
# compatible with. This helps avoid breakage when a new Home Manager release
# introduces backwards incompatible changes.
#
# You should not change this value, even if you update Home Manager. If you do
# want to update the value, then make sure to first check the Home Manager
# release notes.
options.stateVersion = lib.mkOption {
type = lib.types.str;
description = "The state version when the configuration was initially created";
};
options.profile = lib.mkOption {
type = lib.types.enum [ "personal" "work" ];
default = "personal";
description = "Profile type for the Home Manager configuration.";
};
options.root = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether enable all the root user stuff";
};
options.enableShell = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable all the zsh stuff";
};
options.ssh = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable SSH configuration";
};
options._1password = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable 1 password stuff";
};
options.extraImports = lib.mkOption {
type = lib.types.listOf lib.types.anything;
default = [];
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 = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether this system has a graphical environment";
};
options.steam = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether this system has Steam installed";
};
}

16
nixosModules/scripts.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, pkgs, ... }:
let
hostName = config.networking.hostName;
in
{
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake $(readlink -f /etc/nixos)#${hostName} --impure
'')
(pkgs.writeShellScriptBin "nfsu" ''
FLAKE=$(readlink -f /etc/nixos)
nix flake update --flake $FLAKE --impure
sudo nixos-rebuild switch --flake $FLAKE#${hostName} --impure
'')
];
}

10
nixosModules/steam.nix Normal file
View File

@@ -0,0 +1,10 @@
{ config, pkgs, lib, ... }:
{
programs.steam = lib.mkIf config.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
};
}

3
personal_keys Normal file
View File

@@ -0,0 +1,3 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDIaHS9CLiDc6T1tja0fBwwv5qc6iwuckWN6w8MNo5yiR8LPWyrfueowNJkL4HMqu6OEuggtdybGw1Do4sW5o+toHCyWfZf3khI1l15opPXuVpD4CWED+SpJiZ0wBgRaCaWhfxLI+s4JOhjOO2OjiClPX3HfxIHyTpRiR78lOMcIieHSnzrAV2MatYKf6lL2ckOsIPwxo/OVM+1ljjX+HLq9IxGUCpWOnF4nF1rq3gKL2JUh2KsrgrzE3NB7EFuqKm8F0tF2rG3JjSvlwox0h06drKD02lpZWXPOBRlcyFDpNXymmc2bpG0S2Bbj5g+pqNBB0jO0h3kzWvYYqrtU/ElObg1cXhyi0PFOhhptlbhbK0Ao8B+pAbSZ661nMT3jpRWLVbnJrRFnXXdjX08r5eseQ3k4CFpv+g64n7yg3IMo9f8gA9P/hOexR+qu5AQ1Ad/tvkp6pPXnR/zsUnbe4p2A9MaNJm4E1zxbs5VGlXynNikXwDL+spkrnjwdfUULTk= john@JOHN-PC
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFn5ilhqaeDsOWSk7y29se2NvxGm8djlfL3RGLokj0q6 john@john-p14s
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHh9SBuxU2dOJHnpGZAE4cwe0fXcTBBAx+JmRsmIX+Tk8zooeM32vbNxxSXiZNpBGH5wzHNb534dWexGGG3sOaONmcL7SCoPIvaAdnIn5VsiznerLrzppSbx3Qn8eyF97WAGCcOcIUNmTIDDx1m6zG762WQnoaUEy0Ul5IR7ET5GQxP3p5Qwx8yqfixKDwarvV421sUIxYt9gee31jS9jcI3MFd6EL57hWle95Z8BGpR/Q7sXDBTZQWMZauh5NPwLMZS7k3bHgxXZ7WNOw/J/yts1ckBbvIFJSRNnMuWD0oGnDTL6aivGi+Eiswp0fpKzYGzquB3/wr3VU4G1JcMM5 JuiceSSH

0
work_keys Normal file
View File