mirror of
https://github.com/oqyude/nixos.git
synced 2026-10-07 20:47:14 +03:00
soft coding
This commit is contained in:
@@ -27,10 +27,10 @@ let
|
|||||||
# (default is bashInteractive)
|
# (default is bashInteractive)
|
||||||
user.shell = "${pkgs.zsh}/bin/zsh";
|
user.shell = "${pkgs.zsh}/bin/zsh";
|
||||||
|
|
||||||
# SSH user (matches `User oqyude` in the client's ~/.ssh/config).
|
# SSH user (matches the `User` entries in the client's ~/.ssh/config).
|
||||||
# Default is "nix-on-droid"; home stays at the read-only
|
# Default is "nix-on-droid"; home stays at the read-only
|
||||||
# /data/data/com.termux.nix/files/home either way.
|
# /data/data/com.termux.nix/files/home either way.
|
||||||
user.userName = "oqyude";
|
user.userName = xlib.device.username;
|
||||||
|
|
||||||
# Minimal termux settings (nix-on-droid options only:
|
# Minimal termux settings (nix-on-droid options only:
|
||||||
# environment.*, nix.*, time.*, user.*, system.*, android-integration.*)
|
# environment.*, nix.*, time.*, user.*, system.*, android-integration.*)
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ let
|
|||||||
|
|
||||||
"${config.home.homeDirectory}/Games/PrismLaunchers/${config.home.username}" =
|
"${config.home.homeDirectory}/Games/PrismLaunchers/${config.home.username}" =
|
||||||
".local/share/PrismLauncher";
|
".local/share/PrismLauncher";
|
||||||
"${xlib.dirs.lamet-drive}/Users/oqyude/Music" = "Music";
|
"${xlib.dirs.lamet-drive}/Users/${xlib.device.username}/Music" = "Music";
|
||||||
};
|
};
|
||||||
mkLinks = lib.mapAttrs' (sourcePath: targetPath: {
|
mkLinks = lib.mapAttrs' (sourcePath: targetPath: {
|
||||||
name = targetPath;
|
name = targetPath;
|
||||||
|
|||||||
+8
-8
@@ -218,7 +218,7 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
user = {
|
user = {
|
||||||
name = "oqyude";
|
name = xlib.device.username;
|
||||||
email = "oqyude@gmail.com";
|
email = "oqyude@gmail.com";
|
||||||
};
|
};
|
||||||
pull = {
|
pull = {
|
||||||
@@ -250,31 +250,31 @@
|
|||||||
};
|
};
|
||||||
sapphira = {
|
sapphira = {
|
||||||
HostName = "192.168.1.20";
|
HostName = "192.168.1.20";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
};
|
};
|
||||||
sapphira-tailscale = {
|
sapphira-tailscale = {
|
||||||
HostName = "100.64.0.0";
|
HostName = "100.64.0.0";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
};
|
};
|
||||||
otreca-old = {
|
otreca-old = {
|
||||||
HostName = "217.60.3.12";
|
HostName = "217.60.3.12";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
};
|
};
|
||||||
otreca = {
|
otreca = {
|
||||||
HostName = "109.248.161.5";
|
HostName = "109.248.161.5";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
};
|
};
|
||||||
otreca-tailscale = {
|
otreca-tailscale = {
|
||||||
HostName = "100.64.1.0";
|
HostName = "100.64.1.0";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
};
|
};
|
||||||
rydiwo = {
|
rydiwo = {
|
||||||
HostName = "192.168.1.102";
|
HostName = "192.168.1.102";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
};
|
};
|
||||||
epral = {
|
epral = {
|
||||||
HostName = "192.168.1.101";
|
HostName = "192.168.1.101";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
Port = 8022;
|
Port = 8022;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
+13
-1
@@ -40,6 +40,8 @@ in
|
|||||||
hostname,
|
hostname,
|
||||||
type,
|
type,
|
||||||
username ? "oqyude",
|
username ? "oqyude",
|
||||||
|
uid ? 1000,
|
||||||
|
gid ? 1000,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
device = mkDevice {
|
device = mkDevice {
|
||||||
@@ -47,6 +49,8 @@ in
|
|||||||
hostname
|
hostname
|
||||||
type
|
type
|
||||||
username
|
username
|
||||||
|
uid
|
||||||
|
gid
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
@@ -56,11 +60,19 @@ in
|
|||||||
hostname
|
hostname
|
||||||
type
|
type
|
||||||
username
|
username
|
||||||
|
uid
|
||||||
|
gid
|
||||||
;
|
;
|
||||||
};
|
};
|
||||||
isDesktop = device.isDesktop;
|
isDesktop = device.isDesktop;
|
||||||
isHeadless = device.isHeadless;
|
isHeadless = device.isHeadless;
|
||||||
dirs = mkDirs username;
|
dirs = mkDirs username;
|
||||||
inherit helpers;
|
# Bind the host's ids into the mount helpers, so ntfs3/exfat options
|
||||||
|
# carry the same uid/gid the primary user actually has.
|
||||||
|
helpers = import ./helpers.nix {
|
||||||
|
inherit lib;
|
||||||
|
uid = device.uid;
|
||||||
|
gid = device.gid;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -49,6 +49,12 @@ in
|
|||||||
hostname,
|
hostname,
|
||||||
type,
|
type,
|
||||||
username ? "oqyude",
|
username ? "oqyude",
|
||||||
|
# The primary user is pinned to 1000 rather than left to NixOS'
|
||||||
|
# nextfree logic: the mount helpers below write uid=/gid= into
|
||||||
|
# ntfs3/exfat options, and an NTFS/exFAT volume mounted with a
|
||||||
|
# different id shows every file as owned by `nobody`.
|
||||||
|
uid ? 1000,
|
||||||
|
gid ? 1000,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
capabilities = devices.${type} or (throw "xlib: unknown device type '${type}', expected one of ${lib.concatStringsSep ", " (builtins.attrNames devices)}");
|
capabilities = devices.${type} or (throw "xlib: unknown device type '${type}', expected one of ${lib.concatStringsSep ", " (builtins.attrNames devices)}");
|
||||||
@@ -58,6 +64,8 @@ in
|
|||||||
hostname
|
hostname
|
||||||
type
|
type
|
||||||
username
|
username
|
||||||
|
uid
|
||||||
|
gid
|
||||||
;
|
;
|
||||||
isDesktop = capabilities.desktop;
|
isDesktop = capabilities.desktop;
|
||||||
isHeadless = capabilities.headless;
|
isHeadless = capabilities.headless;
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
|
# The primary user's ids, bound from xlib.device by mkXlib. ntfs3/exfat
|
||||||
|
# volumes carry POSIX ids, so a mount using anything other than the real
|
||||||
|
# uid/gid shows every file as owned by `nobody`.
|
||||||
|
uid,
|
||||||
|
gid,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# Pure helper functions for module definitions.
|
# Pure helper functions for module definitions.
|
||||||
@@ -105,8 +110,8 @@ let
|
|||||||
fsType = "ntfs3";
|
fsType = "ntfs3";
|
||||||
options = [
|
options = [
|
||||||
"defaults"
|
"defaults"
|
||||||
"uid=1000"
|
"uid=${toString uid}"
|
||||||
"gid=1000"
|
"gid=${toString gid}"
|
||||||
"fmask=${mask}"
|
"fmask=${mask}"
|
||||||
"dmask=${mask}"
|
"dmask=${mask}"
|
||||||
"nofail"
|
"nofail"
|
||||||
@@ -128,8 +133,8 @@ let
|
|||||||
fsType = "exfat";
|
fsType = "exfat";
|
||||||
options = [
|
options = [
|
||||||
"nofail"
|
"nofail"
|
||||||
"uid=1000"
|
"uid=${toString uid}"
|
||||||
"gid=1000"
|
"gid=${toString gid}"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs,
|
inputs,
|
||||||
|
xlib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -185,7 +186,7 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
user = {
|
user = {
|
||||||
name = "oqyude";
|
name = xlib.device.username;
|
||||||
email = "oqyude@gmail.com";
|
email = "oqyude@gmail.com";
|
||||||
};
|
};
|
||||||
pull = {
|
pull = {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
xlib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
@@ -20,7 +21,7 @@
|
|||||||
};
|
};
|
||||||
shellInit = ''
|
shellInit = ''
|
||||||
beet-p() {
|
beet-p() {
|
||||||
local base="/home/oqyude/.config/beets/My"
|
local base="${xlib.dirs.user-home}/.config/beets/My"
|
||||||
local rel
|
local rel
|
||||||
rel=$(realpath --relative-to="$base" "$PWD")
|
rel=$(realpath --relative-to="$base" "$PWD")
|
||||||
beet mod "path:$rel" playlist="$*"
|
beet mod "path:$rel" playlist="$*"
|
||||||
@@ -29,7 +30,7 @@
|
|||||||
beet im ./ -S $*
|
beet im ./ -S $*
|
||||||
}
|
}
|
||||||
beet-path() {
|
beet-path() {
|
||||||
realpath --relative-to="/home/oqyude/.config/beets/My" "$1"
|
realpath --relative-to="${xlib.dirs.user-home}/.config/beets/My" "$1"
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
gc = "git add . && git commit -m 'dev: автокоммит $(date +'%Y-%m-%d %H:%M:%S')'";
|
gc = "git add . && git commit -m 'dev: автокоммит $(date +'%Y-%m-%d %H:%M:%S')'";
|
||||||
y = "yazi";
|
y = "yazi";
|
||||||
nix-shellp = "nix-shell --run $SHELL -p";
|
nix-shellp = "nix-shell --run $SHELL -p";
|
||||||
beet-path-library = "realpath --relative-to='/home/oqyude/.config/beets/My' .";
|
beet-path-library = "realpath --relative-to='${xlib.dirs.user-home}/.config/beets/My' .";
|
||||||
z-proxy = "export ALL_PROXY=socks5://localhost:10808";
|
z-proxy = "export ALL_PROXY=socks5://localhost:10808";
|
||||||
zh-proxy = "export HTTPS_PROXY=http://localhost:10808 && export HTTP_PROXY=http://localhost:10808";
|
zh-proxy = "export HTTPS_PROXY=http://localhost:10808 && export HTTP_PROXY=http://localhost:10808";
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,13 @@
|
|||||||
description = "Prebuild NixOS closure";
|
description = "Prebuild NixOS closure";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
CPUQuota = "20%";
|
CPUQuota = "20%";
|
||||||
User = "oqyude";
|
User = xlib.device.username;
|
||||||
Group = "users";
|
Group = "users";
|
||||||
Nice = 10;
|
Nice = 10;
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
WorkingDirectory = "/tmp";
|
WorkingDirectory = "/tmp";
|
||||||
Environment = [
|
Environment = [
|
||||||
"HOME=/home/oqyude"
|
"HOME=${xlib.dirs.user-home}"
|
||||||
];
|
];
|
||||||
ExecStart = ''
|
ExecStart = ''
|
||||||
${pkgs.nix}/bin/nix build --no-link /etc/nixos#nixosConfigurations.${config.networking.hostName}.config.system.build.toplevel
|
${pkgs.nix}/bin/nix build --no-link /etc/nixos#nixosConfigurations.${config.networking.hostName}.config.system.build.toplevel
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
dbtype = "pgsql";
|
dbtype = "pgsql";
|
||||||
dbuser = "nextcloud";
|
dbuser = "nextcloud";
|
||||||
dbname = "nextcloud";
|
dbname = "nextcloud";
|
||||||
adminuser = "oqyude";
|
adminuser = xlib.device.username;
|
||||||
adminpassFile = config.sops.secrets.nextcloud-adminpass.path;
|
adminpassFile = config.sops.secrets.nextcloud-adminpass.path;
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
@@ -44,6 +44,12 @@ in
|
|||||||
name = "${user}";
|
name = "${user}";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
group = "users";
|
group = "users";
|
||||||
|
# Pinned, not left to NixOS' nextfree logic: the ntfs3/exfat mount
|
||||||
|
# helpers (lib/xlib/helpers.nix) write the same uid into their mount
|
||||||
|
# options, so both sides have to agree or NTFS files show up as owned
|
||||||
|
# by `nobody`. NixOS has no per-user `gid` option — the primary group
|
||||||
|
# id comes from `group` above.
|
||||||
|
uid = xlib.device.uid;
|
||||||
description = "Jor Oqyude";
|
description = "Jor Oqyude";
|
||||||
hashedPasswordFile = config.sops.secrets.hashed_password.path; # hashed_password
|
hashedPasswordFile = config.sops.secrets.hashed_password.path; # hashed_password
|
||||||
homeMode = "700";
|
homeMode = "700";
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
serviceName = "rsync-services-sync";
|
serviceName = "rsync-services-sync";
|
||||||
serverAddress = "oqyude@100.64.0.0";
|
serverAddress = "${xlib.device.username}@100.64.0.0";
|
||||||
serverDir = "${xlib.dirs.services-nodes-folder}/${xlib.device.hostname}";
|
serverDir = "${xlib.dirs.services-nodes-folder}/${xlib.device.hostname}";
|
||||||
nodeDir = "${xlib.dirs.services-mnt-folder}";
|
nodeDir = "${xlib.dirs.services-mnt-folder}";
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# shared container modules live in ../../containers
|
# shared container modules live in ../../containers
|
||||||
# ../../containers/3x-ui.nix
|
../../containers/silero-tts.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
|||||||
Reference in New Issue
Block a user