Compare commits
10 Commits
main
...
split-grap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d5b15fb63 | ||
|
|
92067f8b69 | ||
|
|
cc21dcdc92 | ||
|
|
ac9e58ede6 | ||
|
|
be57ba16dd | ||
|
|
2fd6a2c04a | ||
|
|
09e941abbd | ||
|
|
e21c901e94 | ||
|
|
ce738ae612 | ||
|
|
ddf5bcaeee |
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
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
25
flake.nix
25
flake.nix
@@ -22,7 +22,10 @@
|
|||||||
|
|
||||||
# These will get applied to both the configured user and the root user (if enabled)
|
# 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 [
|
||||||
|
(lib.mkIf (config.profile == "personal") { keyFiles = [ ./keys/personal ]; })
|
||||||
|
(lib.mkIf (config.profile == "work") { keyFiles = [ ./keys/work ]; })
|
||||||
|
]);
|
||||||
shell = lib.mkIf config.enableShell pkgs.zsh;
|
shell = lib.mkIf config.enableShell pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -38,7 +41,6 @@
|
|||||||
_1password = config._1password;
|
_1password = config._1password;
|
||||||
docker = config.docker;
|
docker = config.docker;
|
||||||
graphical = config.graphical;
|
graphical = config.graphical;
|
||||||
steam = config.steam;
|
|
||||||
}
|
}
|
||||||
] ++ config.extraImports;
|
] ++ config.extraImports;
|
||||||
|
|
||||||
@@ -54,14 +56,17 @@
|
|||||||
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;
|
{
|
||||||
description = "John Lancaster";
|
isNormalUser = true;
|
||||||
extraGroups = []
|
description = "John Lancaster";
|
||||||
++ lib.optionals config.root [ "wheel" ]
|
extraGroups = []
|
||||||
++ lib.optionals config.docker [ "docker" ]
|
++ lib.optional config.root "wheel"
|
||||||
++ lib.optionals config.networking.networkmanager.enable [ "networkmanager" ];
|
++ lib.optional config.docker "docker"
|
||||||
} // userOptions config;
|
++ 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 {
|
||||||
|
|||||||
@@ -62,15 +62,10 @@
|
|||||||
# # 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.optionals config.graphical [
|
]
|
||||||
discord
|
++ lib.optional config.graphical.discord discord
|
||||||
spotify
|
++ lib.optional config.graphical.joplin joplin-desktop
|
||||||
sublime4
|
++ lib.optional config.graphical.sublime 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 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
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, lib, nixgl, ... }:
|
{ config, pkgs, lib, nixgl, ... }:
|
||||||
{
|
{
|
||||||
home.sessionVariables = lib.mkIf (config.enableShell && config.graphical) {
|
home.sessionVariables = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||||
TERMINAL = "ghostty";
|
TERMINAL = "ghostty";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
nixGL.defaultWrapper = "mesa";
|
nixGL.defaultWrapper = "mesa";
|
||||||
nixGL.installScripts = [ "mesa" ];
|
nixGL.installScripts = [ "mesa" ];
|
||||||
|
|
||||||
programs.ghostty = lib.mkIf (config.enableShell && config.graphical) {
|
programs.ghostty = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
package = config.lib.nixGL.wrap pkgs.ghostty;
|
package = config.lib.nixGL.wrap pkgs.ghostty;
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# https://github.com/ghostty-org/ghostty/discussions/3763#discussioncomment-11699970
|
# https://github.com/ghostty-org/ghostty/discussions/3763#discussioncomment-11699970
|
||||||
xdg.desktopEntries."com.mitchellh.ghostty" = lib.mkIf (config.enableShell && config.graphical) {
|
xdg.desktopEntries."com.mitchellh.ghostty" = lib.mkIf (config.enableShell && config.graphical.ghostty) {
|
||||||
name = "Ghostty";
|
name = "Ghostty";
|
||||||
type = "Application";
|
type = "Application";
|
||||||
comment = "A terminal emulator";
|
comment = "A terminal emulator";
|
||||||
|
|||||||
@@ -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
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
programs.vscode = lib.mkIf config.graphical {
|
programs.vscode = lib.mkIf config.graphical.vscode {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.vscode;
|
package = pkgs.vscode;
|
||||||
profiles.default.extensions = with pkgs.vscode-extensions; [
|
profiles.default.extensions = with pkgs.vscode-extensions; [
|
||||||
|
|||||||
@@ -60,15 +60,19 @@
|
|||||||
description = "Whether to enable docker stuff";
|
description = "Whether to enable docker stuff";
|
||||||
};
|
};
|
||||||
|
|
||||||
options.graphical = lib.mkOption {
|
options.graphical =
|
||||||
type = lib.types.bool;
|
let
|
||||||
default = false;
|
boolOption = lib.mkOption {
|
||||||
description = "Whether this system has a graphical environment";
|
type = lib.types.bool;
|
||||||
};
|
default = false;
|
||||||
|
};
|
||||||
options.steam = lib.mkOption {
|
in
|
||||||
type = lib.types.bool;
|
{
|
||||||
default = false;
|
discord = boolOption;
|
||||||
description = "Whether this system has Steam installed";
|
ghostty = boolOption;
|
||||||
};
|
joplin = boolOption;
|
||||||
|
steam = boolOption;
|
||||||
|
sublime = boolOption;
|
||||||
|
vscode = boolOption;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
programs.steam = lib.mkIf config.steam {
|
programs.steam = lib.mkIf config.graphical.steam {
|
||||||
enable = true;
|
enable = true;
|
||||||
gamescopeSession.enable = true;
|
gamescopeSession.enable = true;
|
||||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||||
|
|||||||
Reference in New Issue
Block a user