Clean up module exports and add module to allow Nix to use an SSH agent
This commit is contained in:
parent
526b6532a5
commit
fa1a81c7f4
@ -1,11 +1,11 @@
|
||||
{
|
||||
all: {
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
options,
|
||||
...
|
||||
}: {
|
||||
imports = [./modules];
|
||||
imports = [all];
|
||||
|
||||
config = {
|
||||
services.haveged.enable = lib.mkDefault true;
|
||||
|
43
flake.nix
43
flake.nix
@ -79,7 +79,8 @@
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: {
|
||||
nixosModules = {
|
||||
nixosModules = let
|
||||
m = {
|
||||
ezpassthru = import ./modules/ezpassthru.nix;
|
||||
ezwg = import ./modules/ezwg.nix;
|
||||
kiosk = import ./modules/kiosk.nix;
|
||||
@ -89,10 +90,23 @@
|
||||
de2 = import ./modules/de2.nix;
|
||||
de3 = import ./modules/de3.nix;
|
||||
ezpc = import ./modules/ezpc.nix;
|
||||
all = import ./modules/default.nix;
|
||||
nix-ssh-agent = import ./modules/nix-ssh-agent.nix;
|
||||
};
|
||||
in
|
||||
m
|
||||
// rec {
|
||||
all = {...}: {
|
||||
imports = builtins.attrValues m;
|
||||
};
|
||||
|
||||
homeManagerModules = {
|
||||
common = import ./common.nix all;
|
||||
common-notgne2 = import ./users/notgne2.nix;
|
||||
common-glooder = import ./users/glooder.nix;
|
||||
common-chekkie = import ./users/chekkie.nix;
|
||||
};
|
||||
|
||||
homeManagerModules = let
|
||||
m = {
|
||||
ezpcusr = import ./home-manager/modules/ezpcusr.nix inputs;
|
||||
colors = import ./home-manager/modules/colors.nix inputs;
|
||||
fonts = import ./home-manager/modules/fonts.nix;
|
||||
@ -101,19 +115,18 @@
|
||||
de2u = import ./home-manager/modules/de2u.nix inputs;
|
||||
de3u = import ./home-manager/modules/de3u.nix inputs;
|
||||
elvish = import ./home-manager/modules/elvish.nix inputs;
|
||||
all = import ./home-manager/modules/default.nix inputs;
|
||||
};
|
||||
in
|
||||
m
|
||||
// rec {
|
||||
all = {...}: {
|
||||
imports = builtins.attrValues m;
|
||||
};
|
||||
|
||||
# Not really modules? but eh
|
||||
nixosModules.common = import ./common.nix;
|
||||
nixosModules.common-notgne2 = import ./users/notgne2.nix;
|
||||
nixosModules.common-glooder = import ./users/glooder.nix;
|
||||
nixosModules.common-chekkie = import ./users/chekkie.nix;
|
||||
|
||||
homeManagerModules.common = import ./home-manager/common.nix inputs;
|
||||
homeManagerModules.common-notgne2 =
|
||||
import ./home-manager/users/notgne2.nix inputs;
|
||||
homeManagerModules.common-glooder = import ./home-manager/users/glooder.nix;
|
||||
homeManagerModules.common-chekkie = import ./home-manager/users/chekkie.nix;
|
||||
common = import ./home-manager/common.nix inputs all;
|
||||
common-notgne2 = import ./home-manager/users/notgne2.nix inputs;
|
||||
common-glooder = import ./home-manager/users/glooder.nix;
|
||||
common-chekkie = import ./home-manager/users/chekkie.nix;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,11 +1,11 @@
|
||||
inputs: {
|
||||
inputs: all: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(import ./modules inputs)
|
||||
all
|
||||
"${inputs.home-manager-clipman}/modules/services/clipman.nix"
|
||||
inputs.hyprland.homeManagerModules.default
|
||||
];
|
||||
|
@ -1,20 +0,0 @@
|
||||
inputs: {
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
(lib.mkAliasOptionModule ["ezpcusr" "gaming"] ["gaming" "enable"])
|
||||
(lib.mkAliasOptionModule ["ezpcusr" "newWine"] ["gaming" "newWine"])
|
||||
|
||||
(import ./ezpcusr.nix inputs)
|
||||
(import ./colors.nix inputs)
|
||||
(import ./gaming.nix inputs)
|
||||
./fonts.nix
|
||||
./kermit.nix
|
||||
(import ./de2u.nix inputs)
|
||||
(import ./de3u.nix inputs)
|
||||
./elvish.nix
|
||||
];
|
||||
}
|
@ -33,12 +33,12 @@ in {
|
||||
options = {
|
||||
lockTime = mkOption {
|
||||
type = types.int;
|
||||
default = 300;
|
||||
default = 600;
|
||||
description = "Time until your screen locks";
|
||||
};
|
||||
offTime = mkOption {
|
||||
type = types.int;
|
||||
default = 600;
|
||||
default = 900;
|
||||
description = "Time until your screen turns off";
|
||||
};
|
||||
};
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./ezwg.nix
|
||||
./kiosk.nix
|
||||
./ezpassthru.nix
|
||||
./fuckingprint.nix
|
||||
./workstation.nix
|
||||
./ezpw.nix
|
||||
./de2.nix
|
||||
./de3.nix
|
||||
./ezpc.nix
|
||||
];
|
||||
}
|
29
modules/nix-ssh-agent.nix
Normal file
29
modules/nix-ssh-agent.nix
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
cfg = config.nix.ssh-agent;
|
||||
in {
|
||||
options.nix.ssh-agent = {
|
||||
sock = lib.mkOption {
|
||||
description = "SSH agent socket for Nix to use";
|
||||
default = "/run/user/1000/ssh-agent";
|
||||
type = lib.types.str;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (cfg.sock != null) {
|
||||
systemd.services.ssh-agent-nix-proxy = {
|
||||
wantedBy = [ "nix-daemon.service" ];
|
||||
before = [ "nix-daemon.service" ];
|
||||
partOf = [ "nix-daemon.service" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.socat}/bin/socat UNIX-LISTEN:/run/nix-ssh-agent,mode=770,group=nixbld,user=root,reuseaddr UNIX-CONNECT:${cfg.sock}";
|
||||
};
|
||||
};
|
||||
|
||||
nix.envVars.SSH_AUTH_SOCK = "/run/nix-ssh-agent";
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user