mirror of
https://github.com/oqyude/nixos.git
synced 2026-06-11 04:30:41 +03:00
refactoring
This commit is contained in:
@@ -11,6 +11,8 @@ let
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
device.type = "primary";
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
with inputs;
|
with inputs;
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ let
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
system.nixos.label = "stock";
|
device.type = "primary";
|
||||||
|
|
||||||
imports = with inputs; [
|
imports = with inputs; [
|
||||||
self.nixosModules.default
|
self.nixosModules.default
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ let
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
device.type = "primary";
|
||||||
|
|
||||||
imports = with inputs; [
|
imports = with inputs; [
|
||||||
./hardware/mini-pc.nix
|
./hardware/mini-pc.nix
|
||||||
./hardware/logitech.nix
|
./hardware/logitech.nix
|
||||||
|
|||||||
+2
-4
@@ -7,10 +7,9 @@ let
|
|||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
last-stable = import inputs.nixpkgs-last-unstable { system = "x86_64-linux"; }; # temp
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
device.type = "server";
|
||||||
|
|
||||||
imports = with inputs; [
|
imports = with inputs; [
|
||||||
sops-nix.nixosModules.sops
|
sops-nix.nixosModules.sops
|
||||||
./hardware/server.nix
|
./hardware/server.nix
|
||||||
@@ -147,7 +146,6 @@ let
|
|||||||
};
|
};
|
||||||
calibre-web = {
|
calibre-web = {
|
||||||
enable = true;
|
enable = true;
|
||||||
#package = last-stable.calibre-web; # temp
|
|
||||||
group = "users";
|
group = "users";
|
||||||
user = "${inputs.zeroq.devices.admin}";
|
user = "${inputs.zeroq.devices.admin}";
|
||||||
options = {
|
options = {
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ let
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
device.type = "vds";
|
||||||
|
|
||||||
imports =
|
imports =
|
||||||
with inputs;
|
with inputs;
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ let
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
device.type = "wsl";
|
||||||
|
|
||||||
imports = with inputs; [
|
imports = with inputs; [
|
||||||
nixos-wsl.nixosModules.default
|
nixos-wsl.nixosModules.default
|
||||||
|
|||||||
+16
-12
@@ -7,16 +7,21 @@ let
|
|||||||
pkgs,
|
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 = [
|
imports = [
|
||||||
inputs.self.homeModules.default
|
inputs.self.homeModules.default
|
||||||
#inputs.self.homeModules.links
|
];
|
||||||
] # ++ (builtins.attrValues inputs.self.homeModules)
|
|
||||||
;
|
|
||||||
xdg = {
|
xdg = {
|
||||||
configFile = {
|
configFile = {
|
||||||
"beets" = {
|
"beets" = {
|
||||||
source = config.lib.file.mkOutOfStoreSymlink "${inputs.zeroq.dirs.storage}/beets/linux";
|
enable = builtins.pathExists beetsPath;
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink beetsPath;
|
||||||
target = "beets";
|
target = "beets";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -24,10 +29,10 @@ let
|
|||||||
autostart.enable = true;
|
autostart.enable = true;
|
||||||
userDirs = {
|
userDirs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
createDirectories = true;
|
createDirectories = false;
|
||||||
desktop = null;
|
desktop = null;
|
||||||
documents = null;
|
documents = null;
|
||||||
download = "${config.home.homeDirectory}/Downloads";
|
download = null;
|
||||||
music = null;
|
music = null;
|
||||||
pictures = null;
|
pictures = null;
|
||||||
publicShare = null;
|
publicShare = null;
|
||||||
@@ -37,12 +42,14 @@ let
|
|||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
file = {
|
file = {
|
||||||
"ssh" = {
|
".ssh" = {
|
||||||
source = config.lib.file.mkOutOfStoreSymlink "${inputs.zeroq.dirs.storage}/ssh/${inputs.zeroq.devices.server.hostname}";
|
enable = builtins.pathExists sshPath;
|
||||||
|
source = config.lib.file.mkOutOfStoreSymlink sshPath;
|
||||||
target = ".ssh";
|
target = ".ssh";
|
||||||
};
|
};
|
||||||
"Music" = {
|
"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";
|
target = "${config.home.homeDirectory}/Music";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -58,9 +65,6 @@ let
|
|||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
users.${inputs.zeroq.devices.admin} = homeModule;
|
users.${inputs.zeroq.devices.admin} = homeModule;
|
||||||
sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
|
sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
|
||||||
# extraSpecialArgs = {
|
|
||||||
# inherit (config.networking) hostName;
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|||||||
+13
-1
@@ -7,7 +7,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./essentials
|
./essentials
|
||||||
#./services
|
|
||||||
|
|
||||||
# Flake modules
|
# Flake modules
|
||||||
inputs.home-manager.nixosModules.home-manager # home-manager module
|
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 = {
|
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