Compare commits
3
Commits
028a6611d2
...
8b6d8bd092
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b6d8bd092 | ||
|
|
7c283c61c4 | ||
|
|
385c26f3a0 |
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.shell.bash;
|
cfg = config.shell.bash;
|
||||||
inherit (config.home) username;
|
inherit (config.home) homeDirectory;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.shell.bash = {
|
options.shell.bash = {
|
||||||
@@ -54,12 +54,12 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
for f in /home/${username}/.bashrc.d/*; do
|
for f in ${homeDirectory}/.bashrc.d/*; do
|
||||||
[ -f "$f" ] && source "$f"
|
[ -f "$f" ] && source "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
${lib.optionalString cfg.aliases.all "source /home/${username}/.bash_aliases/all"}
|
${lib.optionalString cfg.aliases.all "source ${homeDirectory}/.bash_aliases/all"}
|
||||||
${lib.optionalString cfg.aliases.lang-js "source /home/${username}/.bash_aliases/lang-js"}
|
${lib.optionalString cfg.aliases.lang-js "source ${homeDirectory}/.bash_aliases/lang-js"}
|
||||||
|
|
||||||
${cfg.extraInit}
|
${cfg.extraInit}
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -101,9 +101,12 @@ in
|
|||||||
useNetworkd = true;
|
useNetworkd = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.network.networks."40-wlan0" = {
|
systemd.network = {
|
||||||
matchConfig.Name = "wlan0";
|
networks."40-wlan0" = {
|
||||||
networkConfig.DHCP = "yes";
|
matchConfig.Name = "wlan0";
|
||||||
|
networkConfig.DHCP = "yes";
|
||||||
|
};
|
||||||
|
wait-online.anyInterface = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
||||||
|
|||||||
@@ -59,16 +59,7 @@ in
|
|||||||
git
|
git
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings.trusted-users = [ "@wheel" ];
|
||||||
experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
trusted-users = [
|
|
||||||
"root"
|
|
||||||
"@wheel"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "26.05";
|
system.stateVersion = "26.05";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,16 +112,7 @@ in
|
|||||||
git
|
git
|
||||||
];
|
];
|
||||||
|
|
||||||
nix.settings = {
|
nix.settings.trusted-users = [ "@wheel" ];
|
||||||
experimental-features = [
|
|
||||||
"nix-command"
|
|
||||||
"flakes"
|
|
||||||
];
|
|
||||||
trusted-users = [
|
|
||||||
"root"
|
|
||||||
"@wheel"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "26.05";
|
system.stateVersion = "26.05";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
inherit (config.host) username;
|
inherit (config.host) username;
|
||||||
|
home = config.users.users.${username}.home;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf config.ssh.enable {
|
config = lib.mkIf config.ssh.enable {
|
||||||
system.activationScripts.extractSshKeys = lib.stringAfter [ "etc" ] ''
|
system.activationScripts.extractSshKeys = lib.stringAfter [ "etc" ] ''
|
||||||
HOST_KEY="/etc/ssh/ssh_host_ed25519_key.pub"
|
HOST_KEY="/etc/ssh/ssh_host_ed25519_key.pub"
|
||||||
HOST_DIR="/home/${username}/nix/hosts/${config.networking.hostName}"
|
HOST_DIR="${home}/nix/hosts/${config.networking.hostName}"
|
||||||
|
|
||||||
if [ -f "$HOST_KEY" ] && [ -d "$HOST_DIR" ]; then
|
if [ -f "$HOST_KEY" ] && [ -d "$HOST_DIR" ]; then
|
||||||
cp "$HOST_KEY" "$HOST_DIR/ssh_host.pub"
|
cp "$HOST_KEY" "$HOST_DIR/ssh_host.pub"
|
||||||
@@ -17,8 +18,8 @@ in
|
|||||||
|
|
||||||
USER_KEY=""
|
USER_KEY=""
|
||||||
for candidate in \
|
for candidate in \
|
||||||
"/home/${username}/.ssh/id_ed25519_sk.pub" \
|
"${home}/.ssh/id_ed25519_sk.pub" \
|
||||||
"/home/${username}/.ssh/id_ed25519.pub"; do
|
"${home}/.ssh/id_ed25519.pub"; do
|
||||||
if [ -f "$candidate" ]; then
|
if [ -f "$candidate" ]; then
|
||||||
USER_KEY="$candidate"
|
USER_KEY="$candidate"
|
||||||
break
|
break
|
||||||
|
|||||||
@@ -5,6 +5,5 @@
|
|||||||
|
|
||||||
config = lib.mkIf config.storage.enable {
|
config = lib.mkIf config.storage.enable {
|
||||||
services.udisks2.enable = true;
|
services.udisks2.enable = true;
|
||||||
boot.zfs.forceImportRoot = false;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
let
|
let
|
||||||
cfg = config.syncthing;
|
cfg = config.syncthing;
|
||||||
inherit (config.host) username;
|
inherit (config.host) username;
|
||||||
|
home = config.users.users.${username}.home;
|
||||||
|
|
||||||
deviceRegistry = import ./devices.nix;
|
deviceRegistry = import ./devices.nix;
|
||||||
deviceName = lib.types.enum (builtins.attrNames deviceRegistry);
|
deviceName = lib.types.enum (builtins.attrNames deviceRegistry);
|
||||||
@@ -48,7 +49,7 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
user = username;
|
user = username;
|
||||||
group = username;
|
group = username;
|
||||||
configDir = "/home/${username}/.local/state/syncthing";
|
configDir = "${home}/.local/state/syncthing";
|
||||||
openDefaultPorts = true;
|
openDefaultPorts = true;
|
||||||
settings = {
|
settings = {
|
||||||
devices = lib.mapAttrs (_: id: { inherit id; }) (lib.getAttrs referencedDevices deviceRegistry);
|
devices = lib.mapAttrs (_: id: { inherit id; }) (lib.getAttrs referencedDevices deviceRegistry);
|
||||||
|
|||||||
Reference in New Issue
Block a user