mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-10 20:20:41 +03:00
refactoring
This commit is contained in:
@@ -11,6 +11,8 @@ let
|
||||
...
|
||||
}:
|
||||
{
|
||||
device.type = "primary";
|
||||
|
||||
imports =
|
||||
with inputs;
|
||||
[
|
||||
|
||||
@@ -11,7 +11,7 @@ let
|
||||
...
|
||||
}:
|
||||
{
|
||||
system.nixos.label = "stock";
|
||||
device.type = "primary";
|
||||
|
||||
imports = with inputs; [
|
||||
self.nixosModules.default
|
||||
|
||||
@@ -11,6 +11,8 @@ let
|
||||
...
|
||||
}:
|
||||
{
|
||||
device.type = "primary";
|
||||
|
||||
imports = with inputs; [
|
||||
./hardware/mini-pc.nix
|
||||
./hardware/logitech.nix
|
||||
|
||||
+2
-4
@@ -7,10 +7,9 @@ let
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
last-stable = import inputs.nixpkgs-last-unstable { system = "x86_64-linux"; }; # temp
|
||||
in
|
||||
{
|
||||
device.type = "server";
|
||||
|
||||
imports = with inputs; [
|
||||
sops-nix.nixosModules.sops
|
||||
./hardware/server.nix
|
||||
@@ -147,7 +146,6 @@ let
|
||||
};
|
||||
calibre-web = {
|
||||
enable = true;
|
||||
#package = last-stable.calibre-web; # temp
|
||||
group = "users";
|
||||
user = "${inputs.zeroq.devices.admin}";
|
||||
options = {
|
||||
|
||||
@@ -9,6 +9,8 @@ let
|
||||
...
|
||||
}:
|
||||
{
|
||||
device.type = "vds";
|
||||
|
||||
imports =
|
||||
with inputs;
|
||||
[
|
||||
|
||||
@@ -9,6 +9,7 @@ let
|
||||
...
|
||||
}:
|
||||
{
|
||||
device.type = "wsl";
|
||||
|
||||
imports = with inputs; [
|
||||
nixos-wsl.nixosModules.default
|
||||
|
||||
+16
-12
@@ -7,16 +7,21 @@ let
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Paths
|
||||
beetsPath = "${inputs.zeroq.dirs.storage}/beets/linux";
|
||||
sshPath = "${inputs.zeroq.dirs.storage}/ssh/${inputs.zeroq.devices.server.hostname}";
|
||||
musicPath = "${config.home.homeDirectory}/External/Music";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.self.homeModules.default
|
||||
#inputs.self.homeModules.links
|
||||
] # ++ (builtins.attrValues inputs.self.homeModules)
|
||||
;
|
||||
];
|
||||
xdg = {
|
||||
configFile = {
|
||||
"beets" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${inputs.zeroq.dirs.storage}/beets/linux";
|
||||
enable = builtins.pathExists beetsPath;
|
||||
source = config.lib.file.mkOutOfStoreSymlink beetsPath;
|
||||
target = "beets";
|
||||
};
|
||||
};
|
||||
@@ -24,10 +29,10 @@ let
|
||||
autostart.enable = true;
|
||||
userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
createDirectories = false;
|
||||
desktop = null;
|
||||
documents = null;
|
||||
download = "${config.home.homeDirectory}/Downloads";
|
||||
download = null;
|
||||
music = null;
|
||||
pictures = null;
|
||||
publicShare = null;
|
||||
@@ -37,12 +42,14 @@ let
|
||||
};
|
||||
home = {
|
||||
file = {
|
||||
"ssh" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${inputs.zeroq.dirs.storage}/ssh/${inputs.zeroq.devices.server.hostname}";
|
||||
".ssh" = {
|
||||
enable = builtins.pathExists sshPath;
|
||||
source = config.lib.file.mkOutOfStoreSymlink sshPath;
|
||||
target = ".ssh";
|
||||
};
|
||||
"Music" = {
|
||||
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/External/Music";
|
||||
enable = builtins.pathExists musicPath;
|
||||
source = config.lib.file.mkOutOfStoreSymlink musicPath;
|
||||
target = "${config.home.homeDirectory}/Music";
|
||||
};
|
||||
};
|
||||
@@ -58,9 +65,6 @@ let
|
||||
useUserPackages = true;
|
||||
users.${inputs.zeroq.devices.admin} = homeModule;
|
||||
sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
|
||||
# extraSpecialArgs = {
|
||||
# inherit (config.networking) hostName;
|
||||
# };
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
+13
-1
@@ -7,7 +7,6 @@
|
||||
{
|
||||
imports = [
|
||||
./essentials
|
||||
#./services
|
||||
|
||||
# Flake modules
|
||||
inputs.home-manager.nixosModules.home-manager # home-manager module
|
||||
@@ -36,4 +35,17 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Options
|
||||
options.device.type = lib.mkOption {
|
||||
type = lib.types.enum [
|
||||
"minimal"
|
||||
"primary"
|
||||
"server"
|
||||
"vds"
|
||||
"wsl"
|
||||
];
|
||||
default = "minimal"; # Значение по умолчанию, если не указано
|
||||
description = "Type of device for this host.";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
}:
|
||||
{
|
||||
services = {
|
||||
tailscale.enable = !(config.wsl.enable or false); # true, if not wsl
|
||||
tailscale.enable = config.device.type != "wsl"; # true, if not wsl
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user