WIP
This commit is contained in:
parent
adf3ceb9cb
commit
d21693d584
|
@ -18,6 +18,8 @@
|
|||
../../modules/hardware/yubikey.nix
|
||||
../../modules/hardware/zfs.nix
|
||||
|
||||
../../modules/optional/streamdeck.nix
|
||||
|
||||
./net.nix
|
||||
./fs.nix
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
}
|
||||
];
|
||||
extraSpecialArgs = {
|
||||
nixosConfig = config;
|
||||
#nixosConfig = config;
|
||||
};
|
||||
};
|
||||
# HM zsh needs this or else the startup order is fucked
|
||||
|
|
4
modules/optional/streamdeck.nix
Normal file
4
modules/optional/streamdeck.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
# broken on nixpkgs currently. How fun
|
||||
#programs.streamdeck-ui.enable = true;
|
||||
}
|
|
@ -11,7 +11,8 @@
|
|||
flip
|
||||
attrNames
|
||||
toString
|
||||
flatten
|
||||
mkMerge
|
||||
concatMap
|
||||
;
|
||||
baseOptions = [
|
||||
"x-systemd.idle-timeout=60"
|
||||
|
@ -24,8 +25,8 @@ in {
|
|||
{
|
||||
options.home.smb = mkOption {
|
||||
description = "Samba shares to be mountable under $HOME/smb";
|
||||
default = {};
|
||||
type = types.listOf types.submodule {
|
||||
default = [];
|
||||
type = types.listOf (types.submodule {
|
||||
options = {
|
||||
localPath = mkOption {
|
||||
description = "The path under which the share will be mounted. Defaults to the remotePath";
|
||||
|
@ -52,24 +53,27 @@ in {
|
|||
type = types.boolean;
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
imports = flatten (
|
||||
imports = [
|
||||
{
|
||||
environment.systemPackages = [pkgs.cifs-utils];
|
||||
fileSystems =
|
||||
mkMerge
|
||||
(
|
||||
flip
|
||||
map
|
||||
concatMap
|
||||
(attrNames config.home-manager.users)
|
||||
(
|
||||
user: let
|
||||
parentPath = "${config.home-manager.users.${user}.homeDir}/smb";
|
||||
cfg = config.home-manager.users.user.smb;
|
||||
parentPath = "${config.home-manager.users.${user}.home.homeDirectory}/smb";
|
||||
cfg = config.home-manager.users.${user}.home.smb;
|
||||
in
|
||||
flip map cfg (
|
||||
cfg: {
|
||||
environment.systemPackages = [pkgs.cifs-utils];
|
||||
fileSystems = {
|
||||
"${parentPath}/${cfg.localpath or cfg.remotePath}" = let
|
||||
options =
|
||||
baseOptions
|
||||
|
@ -88,9 +92,10 @@ in {
|
|||
device = "//${cfg.address}/${cfg.remotePath}";
|
||||
fsType = "cifs";
|
||||
};
|
||||
};
|
||||
}
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
];
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
# xournalpp needs this or else it will crash
|
||||
gnome3.adwaita-icon-theme
|
||||
];
|
||||
age.secrets.smb-creds.rekeyFile = ../../secrets/smb.cred.age;
|
||||
|
||||
home-manager.users.patrick = {
|
||||
imports = [
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
{config, ...}: {
|
||||
age.secrets.smb-creds.rekeyFile = ../../secrets/smb.cred.age;
|
||||
{nixosConfig, ...}: {
|
||||
home.smb = let
|
||||
address = "192.168.178.2";
|
||||
credentials = config.age.secrets.smb-creds.path;
|
||||
credentials = nixosConfig.age.secrets.smb-creds.path;
|
||||
in [
|
||||
{
|
||||
inherit address credentials;
|
||||
|
|
Loading…
Reference in a new issue