component restructuring
This commit is contained in:
parent
13e17324da
commit
a76af6013b
11 changed files with 100 additions and 55 deletions
|
@ -2,5 +2,6 @@
|
|||
imports = [
|
||||
./gui
|
||||
./network
|
||||
./terminal
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ lib, pkgs, config, ... }:
|
||||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
|
||||
|
@ -24,7 +24,12 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
config = mkIf config.components.gui.enable {
|
||||
options.components.gui.pass.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.components.gui.enable;
|
||||
};
|
||||
|
||||
config = mkIf (config.components.gui.pass.enable) {
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.pass.withExtensions (ext: [ ext.pass-otp ]))
|
||||
|
|
|
@ -3,10 +3,10 @@ with lib;
|
|||
{
|
||||
options.components.gui.suspend.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
default = config.components.gui.enable;
|
||||
};
|
||||
|
||||
config = mkIf (config.components.gui.enable && config.components.gui.suspend.enable) {
|
||||
config = mkIf (config.components.gui.suspend.enable) {
|
||||
|
||||
systemd.services.screenlock = {
|
||||
before = [ "sleep.target" ];
|
||||
|
|
18
nixos/components/terminal/default.nix
Normal file
18
nixos/components/terminal/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ pkgs, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.components.terminal = {
|
||||
enable = lib.mkEnableOption "Terminal configurations";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./direnv.nix
|
||||
./hoard.nix
|
||||
./remote-install.nix
|
||||
./wtf.nix
|
||||
];
|
||||
|
||||
config = mkIf config.components.terminal.enable {
|
||||
# todo extract xorg stuff to prepare wayland
|
||||
};
|
||||
}
|
21
nixos/components/terminal/direnv.nix
Normal file
21
nixos/components/terminal/direnv.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.components.terminal.direnv.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.components.terminal.enable;
|
||||
};
|
||||
config = mkIf (config.components.terminal.direnv.enable) {
|
||||
|
||||
environment.systemPackages = [ pkgs.direnv ];
|
||||
|
||||
home-manager.users.mainUser.programs.direnv.enable = true;
|
||||
|
||||
programs.zsh.interactiveShellInit = ''
|
||||
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
|
||||
'';
|
||||
programs.bash.interactiveShellInit = ''
|
||||
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
|
||||
'';
|
||||
};
|
||||
}
|
26
nixos/components/terminal/remote-install.nix
Normal file
26
nixos/components/terminal/remote-install.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
{
|
||||
options.components.terminal.remote-install.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.components.terminal.enable;
|
||||
};
|
||||
config = mkIf (config.components.terminal.remote-install.enable) {
|
||||
|
||||
services.tor = {
|
||||
enable = true;
|
||||
client.enable = true;
|
||||
relay.onionServices.liveos.map = [{ port = 1337; }];
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "remote-install-start-service" ''
|
||||
echo "starting announcment server to receive remote-install iso onion id"
|
||||
${pkgs.nmap}/bin/ncat -k -l -p 1337
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "remote-install-get-hiddenReceiver" ''
|
||||
sudo cat /var/lib/tor/onion/liveos/hostname
|
||||
'')
|
||||
];
|
||||
};
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{ pkgs, config, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
|
||||
networkStatus =
|
||||
|
@ -375,23 +376,30 @@ let
|
|||
'';
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
options.components.terminal.wtf.enable = mkOption {
|
||||
type = lib.types.bool;
|
||||
default = config.components.terminal.enable;
|
||||
};
|
||||
config = mkIf (config.components.terminal.wtf.enable) {
|
||||
|
||||
services.upower.enable = true;
|
||||
services.upower.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.unstable.wtf
|
||||
(createDashboard {
|
||||
json = qJson;
|
||||
name = "q";
|
||||
})
|
||||
(createDashboard {
|
||||
json = newsJson;
|
||||
name = "news";
|
||||
})
|
||||
#activeUsers
|
||||
#activeTasks
|
||||
pkgs.upower
|
||||
];
|
||||
environment.systemPackages = [
|
||||
pkgs.unstable.wtf
|
||||
(createDashboard {
|
||||
json = qJson;
|
||||
name = "q";
|
||||
})
|
||||
(createDashboard {
|
||||
json = newsJson;
|
||||
name = "news";
|
||||
})
|
||||
#activeUsers
|
||||
#activeTasks
|
||||
pkgs.upower
|
||||
];
|
||||
|
||||
};
|
||||
}
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
|
||||
components.gui.enable = true;
|
||||
components.terminal.enable = true;
|
||||
|
||||
services.nginx.enable = true;
|
||||
|
||||
|
|
|
@ -7,15 +7,12 @@
|
|||
#./icecast.nix
|
||||
./audio.nix
|
||||
./cachix.nix
|
||||
./direnv.nix
|
||||
./mail-stuff.nix
|
||||
./network.nix
|
||||
./packages.nix
|
||||
./remote-install.nix
|
||||
./size.nix
|
||||
./user.nix
|
||||
./yubikey.nix
|
||||
./wtf.nix
|
||||
];
|
||||
|
||||
components.network.sshd.onlyTincAccess = lib.mkDefault true;
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
{ config, pkgs, ... }: {
|
||||
|
||||
environment.systemPackages = [ pkgs.direnv ];
|
||||
|
||||
home-manager.users.mainUser.programs.direnv.enable = true;
|
||||
|
||||
programs.zsh.interactiveShellInit = ''
|
||||
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
|
||||
'';
|
||||
programs.bash.interactiveShellInit = ''
|
||||
eval "$(${pkgs.direnv}/bin/direnv hook bash)"
|
||||
'';
|
||||
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
{ pkgs, ... }: {
|
||||
|
||||
services.tor = {
|
||||
enable = true;
|
||||
client.enable = true;
|
||||
relay.onionServices.liveos.map = [{ port = 1337; }];
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "remote-install-start-service" ''
|
||||
echo "starting announcment server to receive remote-install iso onion id"
|
||||
${pkgs.nmap}/bin/ncat -k -l -p 1337
|
||||
'')
|
||||
(pkgs.writeShellScriptBin "remote-install-get-hiddenReceiver" ''
|
||||
sudo cat /var/lib/tor/onion/liveos/hostname
|
||||
'')
|
||||
];
|
||||
}
|
Loading…
Reference in a new issue