Compare commits

...

4 Commits

Author SHA1 Message Date
Joshua Yuen 44ce54628e
Add discord 2026-06-20 23:26:41 -04:00
Joshua Yuen 893fad3b9c
Add vim extension to VSCodium 2026-06-20 23:26:22 -04:00
Joshua Yuen 50b6262b06
Add GPG config for git signing 2026-06-20 23:25:48 -04:00
Joshua Yuen f5e578c184
Allow unfree packages 2026-06-20 23:23:35 -04:00
13 changed files with 121 additions and 16 deletions

View File

@ -41,11 +41,17 @@
nixpkgs, nixpkgs,
home-manager, home-manager,
install-system, install-system,
nix-vscode-extensions,
stylix, stylix,
... ...
}@inputs: }@inputs:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [ nix-vscode-extensions.overlays.default ];
};
in in
{ {
nixosConfigurations = { nixosConfigurations = {
@ -53,7 +59,6 @@
host = "laptop"; host = "laptop";
profile = "desktop"; profile = "desktop";
username = "josh"; username = "josh";
gpgSigningKey = "0x530DA0331EFE99F5";
in nixpkgs.lib.nixosSystem { in nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {
@ -61,8 +66,8 @@
inherit host; inherit host;
inherit profile; inherit profile;
inherit username; inherit username;
inherit gpgSigningKey;
}; };
pkgs = pkgs;
modules = [ modules = [
./hosts/${host} ./hosts/${host}
]; ];
@ -80,6 +85,7 @@
inherit profile; inherit profile;
inherit username; inherit username;
}; };
pkgs = pkgs;
modules = [ modules = [
./hosts/${host} ./hosts/${host}
]; ];
@ -97,6 +103,7 @@
inherit profile; inherit profile;
inherit username; inherit username;
}; };
pkgs = pkgs;
modules = [ modules = [
(nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix") (nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix")
{ environment.systemPackages = [ install-system.packages.${system}.default ]; } { environment.systemPackages = [ install-system.packages.${system}.default ]; }
@ -114,7 +121,7 @@
inherit profile; inherit profile;
inherit username; inherit username;
}; };
pkgs = nixpkgs.legacyPackages.${system}; pkgs = pkgs;
modules = [ modules = [
./homes/josh/home.nix ./homes/josh/home.nix
stylix.homeModules.stylix stylix.homeModules.stylix

View File

@ -1,4 +1,6 @@
{ {
config,
gpgSigningKey,
lib, lib,
pkgs, pkgs,
profile, profile,
@ -25,6 +27,23 @@ with lib;
]; ];
}; };
programs.git = {
enable = true;
settings = {
user = {
name = "Joshua Yuen";
email = "joshuayuen99@gmail.com";
# We need to do this to pass through the (optional) signing key from the hosts/* file
signingkey = if gpgSigningKey != "" then gpgSigningKey else config.modules.gpg.signingKey;
};
commit.gpgsign = true;
init.defaultBranch = "main";
};
};
# Enable GPG-agent for git signing
modules.gpg.enable = true;
# Let Home Manager install and manage itself # Let Home Manager install and manage itself
programs.home-manager.enable = true; programs.home-manager.enable = true;

View File

@ -12,4 +12,6 @@
./hardware.nix ./hardware.nix
./host-packages.nix ./host-packages.nix
]; ];
modules.gpg.signingKey = "0x530DA0331EFE99F5";
} }

View File

@ -15,7 +15,7 @@ in
imports = [ inputs.home-manager.nixosModules.home-manager ]; imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
useGlobalPkgs = false; useGlobalPkgs = true;
backupFileExtension = "backup"; backupFileExtension = "backup";
extraSpecialArgs = { extraSpecialArgs = {
inherit inherit
@ -24,6 +24,7 @@ in
profile profile
username username
; ;
gpgSigningKey = config.modules.gpg.signingKey;
}; };
users.${username} = { users.${username} = {
imports = [ ../../homes/${username}/home.nix ]; imports = [ ../../homes/${username}/home.nix ];

View File

@ -4,11 +4,12 @@
{ {
imports = [ imports = [
./direnv.nix ./direnv.nix
./discord.nix
./firefox.nix ./firefox.nix
./gpg.nix
./fzf.nix ./fzf.nix
./hyprland ./hyprland
./kitty.nix ./kitty.nix
./overlays.nix
./stylix.nix ./stylix.nix
./vscodium.nix ./vscodium.nix
./walker.nix ./walker.nix

18
modules/homes/discord.nix Normal file
View File

@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.discord;
in
{
config = mkIf cfg.enable {
programs.discord = {
enable = true;
package = pkgs.discord;
};
};
}

31
modules/homes/gpg.nix Normal file
View File

@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.gpg;
in
{
config = mkIf cfg.enable {
services = {
gpg-agent = {
enable = true;
enableSshSupport = true;
enableBashIntegration = true;
enableZshIntegration = true;
pinentry.package = pkgs.pinentry-qt;
};
};
home.packages = [ pkgs.gnupg ];
programs = {
gpg = {
enable = true;
};
};
};
}

View File

@ -1,11 +0,0 @@
{
inputs,
...
}:
{
nixpkgs = {
overlays = [
inputs.nix-vscode-extensions.overlays.default
];
};
}

View File

@ -24,6 +24,7 @@
redhat.ansible redhat.ansible
redhat.vscode-yaml redhat.vscode-yaml
rvest.vs-code-prettier-eslint rvest.vs-code-prettier-eslint
vscodevim.vim
]; ];
}; };
} }

View File

@ -3,7 +3,9 @@
}: }:
{ {
imports = [ imports = [
./discord.nix
./displayManager.nix ./displayManager.nix
./gpg.nix
./hyprland.nix ./hyprland.nix
./localsend.nix ./localsend.nix
./pipewire.nix ./pipewire.nix

View File

@ -0,0 +1,13 @@
{
lib,
...
}:
with lib;
{
options.modules.discord = {
enable = mkEnableOption {
default = false;
description = "Enable Discord";
};
};
}

19
modules/options/gpg.nix Normal file
View File

@ -0,0 +1,19 @@
{
lib,
...
}:
with lib;
{
options.modules.gpg = {
enable = mkEnableOption {
default = false;
description = "Enable gpg-agent";
};
signingKey = mkOption {
type = types.str;
default = "";
description = "The key ID to sign with for git";
};
};
}

View File

@ -23,4 +23,6 @@
modules.shell.defaultShell = "zsh"; modules.shell.defaultShell = "zsh";
modules.pipewire.enable = true; modules.pipewire.enable = true;
modules.discord.enable = true;
} }