...
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
gitignore
|
gitignore
|
||||||
|
result
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
users.mutableUsers = true;
|
users.mutableUsers = true;
|
||||||
|
|
||||||
|
nix.channel.enable = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
|
|||||||
@@ -60,7 +60,6 @@
|
|||||||
(nerdfonts.override {fonts = ["Hack"];})
|
(nerdfonts.override {fonts = ["Hack"];})
|
||||||
];
|
];
|
||||||
|
|
||||||
sound.enable = true;
|
|
||||||
home-manager.users.me.services.swayosd.enable = true;
|
home-manager.users.me.services.swayosd.enable = true;
|
||||||
services.blueman.enable = true;
|
services.blueman.enable = true;
|
||||||
hardware.bluetooth.enable = true;
|
hardware.bluetooth.enable = true;
|
||||||
|
|||||||
41
common/wsl.nix
Normal file
41
common/wsl.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
{ pkgs, inputs, lib, ...}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.nix-wsl.nixosModules.wsl
|
||||||
|
];
|
||||||
|
|
||||||
|
wsl.enable = true;
|
||||||
|
|
||||||
|
wsl.wslConf.user.default = lib.mkForce "me";
|
||||||
|
wsl.interop.register = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
(pkgs.writeShellScriptBin "pw" ''
|
||||||
|
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
|
||||||
|
''
|
||||||
|
)
|
||||||
|
(pkgs.writeShellScriptBin "psh" ''
|
||||||
|
/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
|
||||||
|
''
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
wsl.nativeSystemd = true;
|
||||||
|
wsl.wslConf.interop.appendWindowsPath = true;
|
||||||
|
|
||||||
|
programs.bash.loginShellInit = "";
|
||||||
|
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
ports = [ 2222 ];
|
||||||
|
|
||||||
|
settings.PasswordAuthentication = false;
|
||||||
|
settings.KbdInteractiveAuthentication = false;
|
||||||
|
settings.X11Forwarding = true;
|
||||||
|
extraConfig = ''
|
||||||
|
X11UseLocalhost no
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
22
flake.lock
generated
22
flake.lock
generated
@@ -1451,16 +1451,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726989464,
|
"lastModified": 1739757849,
|
||||||
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
|
"narHash": "sha256-Gs076ot1YuAAsYVcyidLKUMIc4ooOaRGO0PqTY7sBzA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
|
"rev": "9d3d080aec2a35e05a15cedd281c2384767c2cfe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-24.05",
|
"ref": "release-24.11",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@@ -2572,11 +2572,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1728888510,
|
"lastModified": 1741513245,
|
||||||
"narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=",
|
"narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c",
|
"rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -2902,17 +2902,17 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1729275015,
|
"lastModified": 1741892592,
|
||||||
"narHash": "sha256-p9+3KzsoqBVPOY7OlW+C5F0CwSWYApNKbInRb/zenfo=",
|
"narHash": "sha256-ai0XSujeUYInQtp1u6TQfrTx9Vtv9bAOkK63lWcttzk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b9562c824b11473587286eb499680129c2d0d4f1",
|
"rev": "a531c9252bde4165e7a49244e71a57bbfa60ba93",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
|
"ref": "release-24.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b9562c824b11473587286eb499680129c2d0d4f1",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
20
flake.nix
20
flake.nix
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
################################### INPUTS #########################################
|
################################### INPUTS #########################################
|
||||||
inputs = {
|
inputs = {
|
||||||
#nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
|
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/b9562c824b11473587286eb499680129c2d0d4f1";
|
#nixpkgs.url = "github:NixOS/nixpkgs/b9562c824b11473587286eb499680129c2d0d4f1";
|
||||||
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
#nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-24.05";
|
url = "github:nix-community/home-manager/release-24.11";
|
||||||
|
#url = "github:nix-community/home-manager/release-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -240,6 +241,11 @@
|
|||||||
{
|
{
|
||||||
top = builtins.mapAttrs (name: value: value.config.system.build.toplevel) (self.nixOnDroidConfigurations // self.nixosConfigurations);
|
top = builtins.mapAttrs (name: value: value.config.system.build.toplevel) (self.nixOnDroidConfigurations // self.nixosConfigurations);
|
||||||
|
|
||||||
|
img = builtins.mapAttrs (name: value:
|
||||||
|
# build tarball for wsl systems and sdImage for others.....
|
||||||
|
if value.config.wsl.enable then value.config.system.build.tarballBuilder else value.config.system.build.sdImage
|
||||||
|
) (self.nixOnDroidConfigurations // self.nixosConfigurations);
|
||||||
|
|
||||||
# this is my nur repo, that you can import and call with pkgs
|
# this is my nur repo, that you can import and call with pkgs
|
||||||
nur = import ./nur.nix;
|
nur = import ./nur.nix;
|
||||||
|
|
||||||
@@ -408,6 +414,14 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
"mosatop" = nixpkgs.lib.nixosSystem {
|
||||||
|
inherit specialArgs;
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./hosts/mosatop.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
"acern-real" = nixpkgs.lib.nixosSystem {
|
"acern-real" = nixpkgs.lib.nixosSystem {
|
||||||
inherit specialArgs;
|
inherit specialArgs;
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{ pkgs, inputs, secretsDir, ...}:
|
{ pkgs, inputs, secretsDir, ...}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nix-wsl.nixosModules.wsl
|
|
||||||
../users/me/headless.nix
|
../users/me/headless.nix
|
||||||
|
../common/wsl.nix
|
||||||
|
|
||||||
inputs.networkmanager.nixosModules.networkmanager
|
inputs.networkmanager.nixosModules.networkmanager
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
@@ -10,19 +10,6 @@
|
|||||||
../common/nixos-headless.nix
|
../common/nixos-headless.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
wsl.enable = true;
|
|
||||||
|
|
||||||
services.openssh = {
|
|
||||||
enable = true;
|
|
||||||
ports = [ 2222 ];
|
|
||||||
|
|
||||||
settings.PasswordAuthentication = false;
|
|
||||||
settings.KbdInteractiveAuthentication = false;
|
|
||||||
settings.X11Forwarding = true;
|
|
||||||
extraConfig = ''
|
|
||||||
X11UseLocalhost no
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.bash.loginShellInit = "";
|
programs.bash.loginShellInit = "";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
{ inputs, pkgs, secretsDir, ... }:
|
{ inputs, pkgs, secretsDir, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#disabledModules = [ "services/databases/couchdb.nix" ];
|
||||||
imports = [
|
imports = [
|
||||||
|
#"${inputs.nixpkgs-unstable}/nixos/modules/services/databases/couchdb.nix"
|
||||||
../common/all.nix
|
../common/all.nix
|
||||||
../common/nixos.nix
|
../common/nixos.nix
|
||||||
../common/building.nix
|
../common/building.nix
|
||||||
@@ -10,6 +13,7 @@
|
|||||||
../users/me/headless.nix
|
../users/me/headless.nix
|
||||||
../users/root/default.nix
|
../users/root/default.nix
|
||||||
../users/files/headless.nix
|
../users/files/headless.nix
|
||||||
|
../users/server/headless.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# mac address for wakeonlan: 00:19:99:fd:28:23
|
# mac address for wakeonlan: 00:19:99:fd:28:23
|
||||||
@@ -32,6 +36,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
services.resilio = {
|
||||||
|
# TODO: add the config for the share to here
|
||||||
|
enable = true;
|
||||||
|
enableWebUI = true;
|
||||||
|
httpListenAddr = "100.70.54.18";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
boot.supportedFilesystems = [ "zfs" ];
|
boot.supportedFilesystems = [ "zfs" ];
|
||||||
boot.zfs.package = pkgs.zfs_unstable;
|
boot.zfs.package = pkgs.zfs_unstable;
|
||||||
boot.zfs.forceImportRoot = false;
|
boot.zfs.forceImportRoot = false;
|
||||||
@@ -83,6 +96,12 @@
|
|||||||
networking.firewall.allowPing = true;
|
networking.firewall.allowPing = true;
|
||||||
networking.firewall.enable = true;
|
networking.firewall.enable = true;
|
||||||
|
|
||||||
|
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
|
||||||
|
443 # couchdb for obsidian live sync https
|
||||||
|
44444 # resilio sync
|
||||||
|
9000 # resilio webui
|
||||||
|
];
|
||||||
|
|
||||||
services.samba.openFirewall = true;
|
services.samba.openFirewall = true;
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
@@ -154,6 +173,14 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
############################ couchdb for Obsidian Live sync
|
||||||
|
#services.couchdb.enable = true;
|
||||||
|
#services.couchdb.extraConfigFiles = [ "/home/files/storage/files/stuff/obsidian-live-sync/local.ini" ];
|
||||||
|
#services.couchdb.databaseDir = "/home/files/storage/files/stuff/obsidian-live-sync/data";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
############################ update ip service
|
############################ update ip service
|
||||||
|
|
||||||
systemd.services.update-ip =
|
systemd.services.update-ip =
|
||||||
@@ -240,16 +267,16 @@
|
|||||||
services.samba = {
|
services.samba = {
|
||||||
enable = true;
|
enable = true;
|
||||||
securityType = "user";
|
securityType = "user";
|
||||||
extraConfig = ''
|
settings = {
|
||||||
server role = standalone server
|
global = {
|
||||||
map to guest = bad user
|
"server role" = "standalone server";
|
||||||
usershare allow guests = yes
|
"map to guest" = "bad user";
|
||||||
hosts allow = 192.168.0.0/16
|
"usershare allow guests" = "yes";
|
||||||
hosts deny = 0.0.0.0
|
# "hosts allow" = "192.168.1 127.0.0.1 localhost";
|
||||||
workgroup = WORKGROUP
|
# "hosts deny" = "0.0.0.0/0";
|
||||||
security = user
|
"workgroup" = "WORKGROUP";
|
||||||
'';
|
"security" = "user";
|
||||||
shares = {
|
};
|
||||||
files = {
|
files = {
|
||||||
"valid users" = "files";
|
"valid users" = "files";
|
||||||
"comment" = "all my files";
|
"comment" = "all my files";
|
||||||
|
|||||||
@@ -146,6 +146,7 @@
|
|||||||
type = "wifi";
|
type = "wifi";
|
||||||
interface-name = "wlan0";
|
interface-name = "wlan0";
|
||||||
autoconnect = true;
|
autoconnect = true;
|
||||||
|
autoconnect-priority = "-200";
|
||||||
};
|
};
|
||||||
|
|
||||||
wifi = {
|
wifi = {
|
||||||
@@ -172,6 +173,7 @@
|
|||||||
type = "wifi";
|
type = "wifi";
|
||||||
interface-name = "wlan0";
|
interface-name = "wlan0";
|
||||||
autoconnect = true;
|
autoconnect = true;
|
||||||
|
autoconnect-priority = "-999";
|
||||||
};
|
};
|
||||||
|
|
||||||
wifi = {
|
wifi = {
|
||||||
@@ -185,6 +187,25 @@
|
|||||||
psk = builtins.readFile "${secretsDir}/home-wifi-password";
|
psk = builtins.readFile "${secretsDir}/home-wifi-password";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
ipv4 = {
|
||||||
|
method = "auto";
|
||||||
|
address1 = "192.168.1.37/24";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
dhcp = {
|
||||||
|
connection = {
|
||||||
|
id = "dhcp";
|
||||||
|
uuid = "c006389a-1697-4f77-91c3-95b466f85f13";
|
||||||
|
type = "ethernet";
|
||||||
|
autoconnect = "false";
|
||||||
|
interface-name = "end0";
|
||||||
|
};
|
||||||
|
|
||||||
|
ethernet = {
|
||||||
|
mac-address = "DC:A6:32:CB:4D:5E";
|
||||||
|
};
|
||||||
|
|
||||||
ipv4 = {
|
ipv4 = {
|
||||||
method = "auto";
|
method = "auto";
|
||||||
};
|
};
|
||||||
@@ -196,11 +217,11 @@
|
|||||||
uuid = "f55f34e3-4595-4642-b1f6-df3185bc0a04";
|
uuid = "f55f34e3-4595-4642-b1f6-df3185bc0a04";
|
||||||
type = "ethernet";
|
type = "ethernet";
|
||||||
autoconnect = false;
|
autoconnect = false;
|
||||||
interface-name = "eth0";
|
interface-name = "end0";
|
||||||
};
|
};
|
||||||
|
|
||||||
ethernet = {
|
ethernet = {
|
||||||
mac-address = "F4:39:09:4A:DF:0E";
|
mac-address = "DC:A6:32:CB:4D:5E";
|
||||||
};
|
};
|
||||||
|
|
||||||
ipv4 = {
|
ipv4 = {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ in {
|
|||||||
|
|
||||||
restartIfChanged = false;
|
restartIfChanged = false;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.cage}/bin/cage -d -- ${myobs}/bin/obs";
|
ExecStart = "${pkgs.cage}/bin/cage -d -- ${pkgs.moonlight-qt}/bin/moonlight";
|
||||||
User = "root";
|
User = "root";
|
||||||
|
|
||||||
# ConditionPathExists = "/dev/tty0";
|
# ConditionPathExists = "/dev/tty0";
|
||||||
|
|||||||
113
hosts/main.nix
113
hosts/main.nix
@@ -35,8 +35,44 @@
|
|||||||
|
|
||||||
#services.openssh.enable = true;
|
#services.openssh.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
services.sunshine = {
|
||||||
|
package = pkgs.sunshine.overrideAttrs {
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "garnacho";
|
||||||
|
repo = "Sunshine";
|
||||||
|
rev = "xdg-portal";
|
||||||
|
hash = "sha256-To1vhNQxjIa5Hc+z2xo+ODSQyIH6cnI3A7Ofc7MDL60=";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
enable = true;
|
||||||
|
autoStart = true;
|
||||||
|
capSysAdmin = true;
|
||||||
|
openFirewall = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtualisation.vmVariant.services.timesyncd.enable = lib.mkForce false;
|
virtualisation.vmVariant.services.timesyncd.enable = lib.mkForce false;
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
|
||||||
|
services.resilio = {
|
||||||
|
enable = true;
|
||||||
|
enableWebUI = true;
|
||||||
|
};
|
||||||
|
users.users.me.homeMode = "770"; # important for resilio
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
virtualisation.waydroid.enable = true;
|
virtualisation.waydroid.enable = true;
|
||||||
|
|
||||||
@@ -60,6 +96,16 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
################# make firefox default browser
|
||||||
|
xdg.mime.defaultApplications = {
|
||||||
|
"text/html" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/http" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/https" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/about" = "firefox.desktop";
|
||||||
|
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# disable touch clicks because i always tap while typing
|
# disable touch clicks because i always tap while typing
|
||||||
@@ -89,6 +135,16 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
services.udev.packages = [ inputs.waveforms.packages.${system}.adept2-runtime ];
|
services.udev.packages = [ inputs.waveforms.packages.${system}.adept2-runtime ];
|
||||||
|
users.users.rslsync.extraGroups = ["users"];
|
||||||
|
|
||||||
|
# add myself to plugdev group for waveforms
|
||||||
|
# and incus-admin to use incus without sudo
|
||||||
|
users.users.me.extraGroups = [ "incus-admin" "plugdev" "rslsync" ];
|
||||||
|
|
||||||
|
|
||||||
|
nixpkgs.config.permittedInsecurePackages = [
|
||||||
|
"python-2.7.18.8"
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
@@ -251,10 +307,14 @@
|
|||||||
#networking.useDHCP = lib.mkForce true;
|
#networking.useDHCP = lib.mkForce true;
|
||||||
|
|
||||||
networking.firewall.allowPing = true;
|
networking.firewall.allowPing = true;
|
||||||
networking.firewall.enable = false;
|
networking.firewall.enable = true;
|
||||||
|
|
||||||
services.samba.openFirewall = true;
|
services.samba.openFirewall = true;
|
||||||
|
|
||||||
|
networking.firewall.interfaces."tailscale0".allowedTCPPorts = [
|
||||||
|
44444 # resilio sync
|
||||||
|
];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [
|
||||||
5357 # wsdd
|
5357 # wsdd
|
||||||
8888 # for general usage
|
8888 # for general usage
|
||||||
@@ -485,42 +545,49 @@
|
|||||||
# */
|
# */
|
||||||
|
|
||||||
|
|
||||||
|
systemd.services.waydroid = {
|
||||||
|
enable = false;
|
||||||
|
description = "run waydroid session in background";
|
||||||
|
unitConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
RestartSec = "500s";
|
||||||
|
ExecStart = "${pkgs.waydroid}/bin/waydroid session start";
|
||||||
|
User = "me";
|
||||||
|
Group = "users";
|
||||||
|
};
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#################################### samba ######################################
|
#################################### samba ######################################
|
||||||
|
/*
|
||||||
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
|
services.samba-wsdd.enable = true; # make shares visible for windows 10 clients
|
||||||
|
|
||||||
services.samba = {
|
services.samba = {
|
||||||
enable = true;
|
enable = true;
|
||||||
securityType = "user";
|
securityType = "user";
|
||||||
extraConfig = ''
|
settings = {
|
||||||
security = user
|
global = {
|
||||||
map to guest = bad user
|
"security" = "user";
|
||||||
guest account = me
|
"map to guest" = "bad user";
|
||||||
|
"guest account" = "me";
|
||||||
server role = standalone server
|
"server role" = "standalone server";
|
||||||
workgroup = WORKGROUP
|
"workgroup" = "WORKGROUP";
|
||||||
'';
|
};
|
||||||
shares = {
|
|
||||||
rpi_schule = {
|
|
||||||
path = "${workDir}/rpi-schule/";
|
|
||||||
"guest ok" = "yes";
|
|
||||||
"read only" = "no";
|
|
||||||
public = "yes";
|
|
||||||
writable = "yes";
|
|
||||||
printable = "no";
|
|
||||||
comment = "share for rpi in school wlan";
|
|
||||||
};
|
|
||||||
|
|
||||||
share = {
|
share = {
|
||||||
comment = "share for sharing stuff";
|
comment = "share for sharing stuff";
|
||||||
path = "${workDir}/share";
|
path = "${workDir}/share";
|
||||||
public = "yes";
|
public = "yes";
|
||||||
"guest ok" = "yes";
|
"guest ok" = "yes";
|
||||||
"read only" = "no";
|
"read only" = "no";
|
||||||
writable = "yes";
|
writable = "yes";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
######################################### virtualisation ###############################
|
######################################### virtualisation ###############################
|
||||||
@@ -541,10 +608,6 @@
|
|||||||
systemd.services.incus.path = [ pkgs.swtpm ];
|
systemd.services.incus.path = [ pkgs.swtpm ];
|
||||||
#virtualisation.incus.package = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.incus;
|
#virtualisation.incus.package = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.incus;
|
||||||
|
|
||||||
# add myself to plugdev group for waveforms
|
|
||||||
# and incus-admin to use incus without sudo
|
|
||||||
users.users.me.extraGroups = [ "incus-admin" "plugdev" ];
|
|
||||||
|
|
||||||
|
|
||||||
virtualisation.podman.enable = true;
|
virtualisation.podman.enable = true;
|
||||||
|
|
||||||
|
|||||||
62
hosts/mosatop.nix
Normal file
62
hosts/mosatop.nix
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
{ pkgs, inputs, secretsDir, ...}:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../users/me/headless.nix
|
||||||
|
../common/wsl.nix
|
||||||
|
|
||||||
|
inputs.networkmanager.nixosModules.networkmanager
|
||||||
|
inputs.home-manager.nixosModules.home-manager
|
||||||
|
../common/all.nix
|
||||||
|
../common/nixos-headless.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
# to build rpi images
|
||||||
|
boot.binfmt.emulatedSystems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"armv7l-linux"
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
######################### networking #####################################
|
||||||
|
|
||||||
|
networking.hostName = "mosatop";
|
||||||
|
networking.firewall.allowPing = true;
|
||||||
|
networking.firewall.enable = true;
|
||||||
|
networking.firewall.allowedUDPPorts = [
|
||||||
|
3702 # wsdd
|
||||||
|
51820 # wireguard
|
||||||
|
24454 # minecraft voice chat
|
||||||
|
];
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
2222 # sshd
|
||||||
|
8888 # general use
|
||||||
|
9999 # general use
|
||||||
|
25565 # minecraft
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
/*
|
||||||
|
networking.networkmanager.profiles = {
|
||||||
|
me = {
|
||||||
|
connection = {
|
||||||
|
id = "me";
|
||||||
|
uuid = "fe45d3bc-21c6-41ff-bc06-c936017c6e02";
|
||||||
|
type = "wireguard";
|
||||||
|
autoconnect = "true";
|
||||||
|
interface-name = "me0";
|
||||||
|
};
|
||||||
|
wireguard = {
|
||||||
|
listen-port = "51820";
|
||||||
|
private-key = builtins.readFile "${secretsDir}/wg-private-acern";
|
||||||
|
};
|
||||||
|
ipv4 = {
|
||||||
|
address1 = "10.1.1.5/24";
|
||||||
|
method = "manual";
|
||||||
|
};
|
||||||
|
} // (import ../common/wg-peers.nix { inherit secretsDir; }) ;
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
}
|
||||||
@@ -6,3 +6,4 @@
|
|||||||
::1 youtube.com
|
::1 youtube.com
|
||||||
::1 localhost
|
::1 localhost
|
||||||
127.0.0.1 localhost
|
127.0.0.1 localhost
|
||||||
|
100.70.54.18 obsidian.c2vi.dev
|
||||||
|
|||||||
@@ -6,3 +6,5 @@
|
|||||||
192.168.1.1 rou
|
192.168.1.1 rou
|
||||||
192.168.1.1 router
|
192.168.1.1 router
|
||||||
192.168.1.33 mac
|
192.168.1.33 mac
|
||||||
|
192.168.1.36 mosatop
|
||||||
|
192.168.1.37 lush
|
||||||
|
|||||||
39
mybin/nixre
39
mybin/nixre
@@ -3,6 +3,8 @@
|
|||||||
# my nixos rebuild script
|
# my nixos rebuild script
|
||||||
|
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
|
||||||
build_from_github(){
|
build_from_github(){
|
||||||
export NIXPKGS_ALLOW_UNFREE=1
|
export NIXPKGS_ALLOW_UNFREE=1
|
||||||
@@ -38,11 +40,36 @@ build_from_local(){
|
|||||||
return $build_exit_code
|
return $build_exit_code
|
||||||
}
|
}
|
||||||
|
|
||||||
|
build_remote () {
|
||||||
|
|
||||||
|
rsync -r -v $HOME/work/config/* $host:my-nixos-config --exclude=.git --exclude=gitignore
|
||||||
|
|
||||||
|
out_path=$(ssh $host nix build "\$HOME/my-nixos-config#nixosConfigurations.$host.config.system.build.toplevel" --impure --no-link --print-out-paths -v -L "${args_to_pass[@]}")
|
||||||
|
|
||||||
|
if [[ "$out_path" == "" ]]
|
||||||
|
then
|
||||||
|
build_exit_code=1
|
||||||
|
else
|
||||||
|
build_exit_code=0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo out_path: $out_path
|
||||||
|
echo build_exit_code: $build_exit_code
|
||||||
|
|
||||||
|
return $build_exit_code
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
do_switch(){
|
do_switch(){
|
||||||
if [[ "$host" == "$(hostname)" ]]
|
if [[ "$host" == "$(hostname)" ]]
|
||||||
then
|
then
|
||||||
[[ "$boot" == "false" ]] && sudo $out_path/bin/switch-to-configuration switch
|
[[ "$boot" == "false" ]] && sudo $out_path/bin/switch-to-configuration switch
|
||||||
[[ "$boot" == "true" ]] && sudo $out_path/bin/switch-to-configuration boot
|
[[ "$boot" == "true" ]] && sudo $out_path/bin/switch-to-configuration boot
|
||||||
|
elif [[ "$build_remote" == "true" ]]
|
||||||
|
then
|
||||||
|
[[ "$boot" == "false" ]] && ssh $host "sudo nixos-rebuild switch --flake \$HOME/my-nixos-config --impure"
|
||||||
|
[[ "$boot" == "true" ]] && ssh $host "sudo nixos-rebuild boot --flake \$HOME/my-nixos-config --impure"
|
||||||
else
|
else
|
||||||
nix path-info $out_path -r | xargs sudo nix store sign -k ~/work/here/secrets/nix-private
|
nix path-info $out_path -r | xargs sudo nix store sign -k ~/work/here/secrets/nix-private
|
||||||
nix copy --no-check-sigs --no-require-sigs --to ssh-ng://$host $out_path
|
nix copy --no-check-sigs --no-require-sigs --to ssh-ng://$host $out_path
|
||||||
@@ -67,11 +94,12 @@ boot=false
|
|||||||
use_github=""
|
use_github=""
|
||||||
flag=""
|
flag=""
|
||||||
|
|
||||||
while getopts ':gbh:' flag; do
|
while getopts ':rgbh:' flag; do
|
||||||
case "${flag}" in
|
case "${flag}" in
|
||||||
h) host="${OPTARG}";;
|
h) host="${OPTARG}";;
|
||||||
b) boot=true;;
|
b) boot=true;;
|
||||||
g) use_github=true;;
|
g) use_github=true;;
|
||||||
|
r) build_remote=true;;
|
||||||
*) export args_to_pass=( "${@:OPTIND}" ); break;; # makes it so, that at the first unknown option we start passing the rest of the arguments to the nix build command....
|
*) export args_to_pass=( "${@:OPTIND}" ); break;; # makes it so, that at the first unknown option we start passing the rest of the arguments to the nix build command....
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
@@ -84,10 +112,19 @@ done
|
|||||||
#exit
|
#exit
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "$host" == "acern" ]] || [[ "$host" == "mosatop" ]]
|
||||||
|
then
|
||||||
|
build_remote=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [[ "$use_github" == "true" ]]
|
if [[ "$use_github" == "true" ]]
|
||||||
then
|
then
|
||||||
echo rebuild from github
|
echo rebuild from github
|
||||||
build_from_github && do_switch
|
build_from_github && do_switch
|
||||||
|
elif [[ "$build_remote" == "true" ]]
|
||||||
|
then
|
||||||
|
build_remote && do_switch
|
||||||
else
|
else
|
||||||
echo "rebuild from local (~/work/config/)"
|
echo "rebuild from local (~/work/config/)"
|
||||||
build_from_local && do_switch
|
build_from_local && do_switch
|
||||||
|
|||||||
14
mybin/ru
14
mybin/ru
@@ -27,6 +27,18 @@ then
|
|||||||
rclone mount --vfs-cache-mode full -vvvv onedrive-school:projekt-autobatterie ~/work/htl/projekt/wechner/mnt
|
rclone mount --vfs-cache-mode full -vvvv onedrive-school:projekt-autobatterie ~/work/htl/projekt/wechner/mnt
|
||||||
|
|
||||||
|
|
||||||
|
elif [ "$1" == "mnt-host" ]
|
||||||
|
then
|
||||||
|
if [[ "$1" == "-r" ]]
|
||||||
|
then
|
||||||
|
host=$3
|
||||||
|
sshfs $host:/ ~/mnt
|
||||||
|
else
|
||||||
|
host=$2
|
||||||
|
sshfs $host: ~/mnt
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
elif [ "$1" == "mnt-school" ]
|
elif [ "$1" == "mnt-school" ]
|
||||||
then
|
then
|
||||||
rclone mount --vfs-cache-mode full -vvvv onedrive-school: ~/mnt
|
rclone mount --vfs-cache-mode full -vvvv onedrive-school: ~/mnt
|
||||||
@@ -41,7 +53,7 @@ wstunnel -L 55555:127.0.0.1:49388 ws://sebastian.dns.army:49389
|
|||||||
|
|
||||||
elif [ "$1" == "speed-test-nixos-iso" ]
|
elif [ "$1" == "speed-test-nixos-iso" ]
|
||||||
then
|
then
|
||||||
wget -O /tmp/speed-test.iso "https://dl.t2sde.org/binary/2022/t2-22.6-x86-64-minimal-desktop-gcc-glibc.iso"
|
wget -O /tmp/speed-test.iso "https://channels.nixos.org/nixos-24.11/latest-nixos-gnome-x86_64-linux.iso"
|
||||||
rm /tmp/speed-test.iso
|
rm /tmp/speed-test.iso
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
1
mybin/waydroid-session-start
Executable file
1
mybin/waydroid-session-start
Executable file
@@ -0,0 +1 @@
|
|||||||
|
waydroid session start
|
||||||
1
mybin/waydroid-session-stop
Executable file
1
mybin/waydroid-session-stop
Executable file
@@ -0,0 +1 @@
|
|||||||
|
waydroid session stop
|
||||||
@@ -1,19 +1,17 @@
|
|||||||
{ persistentDir, confDir, hostname, self, pkgs, config, system, inputs, workDir, ... }:
|
{ secretsDir, confDir, hostname, self, pkgs, config, system, inputs, workDir, ... }:
|
||||||
{
|
{
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
|
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
|
||||||
historyFile = "/home/$USER/work/app-data/${hostname}/bash-history";
|
historyFile = if hostname == "main" then "/home/$USER/work/app-data/${hostname}/bash-history" else "/home/$USER/here/bash-history";
|
||||||
historyFileSize = 100000;
|
historyFileSize = 100000;
|
||||||
historyControl = [ "ignoredups" ];
|
historyControl = [ "ignoredups" ];
|
||||||
historyIgnore = [
|
historyIgnore = [
|
||||||
"ls"
|
"ls"
|
||||||
"cd"
|
"cd"
|
||||||
"exit"
|
"exit"
|
||||||
"sd vim /etc/hosts"
|
|
||||||
"sd vim /etc/host-youtube-block"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
shellOptions = [
|
shellOptions = [
|
||||||
@@ -46,6 +44,7 @@
|
|||||||
shellAliases = {
|
shellAliases = {
|
||||||
ports = "${pkgs.lsof}/bin/lsof -i -P -n";
|
ports = "${pkgs.lsof}/bin/lsof -i -P -n";
|
||||||
losetup = "${pkgs.util-linux}/bin/losetup";
|
losetup = "${pkgs.util-linux}/bin/losetup";
|
||||||
|
u = "sudo umount ~/mnt";
|
||||||
#log = let
|
#log = let
|
||||||
#log = pkgs.writeShellApplication {
|
#log = pkgs.writeShellApplication {
|
||||||
#name = "log";
|
#name = "log";
|
||||||
@@ -89,7 +88,7 @@
|
|||||||
export PATH=${self}/mybin:$PATH
|
export PATH=${self}/mybin:$PATH
|
||||||
export TERM="xterm-color"
|
export TERM="xterm-color"
|
||||||
export system=${system}
|
export system=${system}
|
||||||
export NIX_PATH=$NIX_PATH:nixpkgs=${self}
|
export NIX_PATH=nixpkgs=${self.inputs.nixpkgs.outPath}
|
||||||
export NIXPKGS_ALLOW_UNFREE=1
|
export NIXPKGS_ALLOW_UNFREE=1
|
||||||
|
|
||||||
# the commit hash of nixpkgs 23.11
|
# the commit hash of nixpkgs 23.11
|
||||||
@@ -113,11 +112,33 @@
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function lf () {
|
function lf () {
|
||||||
${config.programs.lf.package}/bin/lf -last-dir-path /tmp/lf-last-path && cd $(cat /tmp/lf-last-path)
|
${config.programs.lf.package}/bin/lf -last-dir-path /tmp/lf-last-path && cd $(cat /tmp/lf-last-path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function rp () {
|
||||||
|
host=$1
|
||||||
|
|
||||||
|
if [[ "$host" == "mosatop" ]]
|
||||||
|
then
|
||||||
|
xfreerdp /u:"c2vi" /v:mosatop /p:$(cat ${secretsDir}/mosatop-rdp-password) /dynamic-resolution +clipboard +auto-reconnect /wm-class:"Microsoft Windows"
|
||||||
|
|
||||||
|
elif [[ "$host" == "acern" ]]
|
||||||
|
then
|
||||||
|
xfreerdp /u:"seb" /v:acern /p:$(cat ${secretsDir}/acern-rdp-password) /dynamic-resolution +clipboard +auto-reconnect /wm-class:"Microsoft Windows"
|
||||||
|
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
complete -W "mosatop acern" rp
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# so that programms i spawn from my shell don't have so high cpu priority
|
# so that programms i spawn from my shell don't have so high cpu priority
|
||||||
[ which renice 2>/dev/null ] && renice -n 9 $$ > /dev/null
|
[ which renice 2>/dev/null ] && renice -n 9 $$ > /dev/null
|
||||||
|
|
||||||
@@ -178,11 +199,9 @@
|
|||||||
# ------------------------------------------------
|
# ------------------------------------------------
|
||||||
cb() {
|
cb() {
|
||||||
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
|
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
|
||||||
# Check that xclip is installed.
|
|
||||||
if ! type xclip > /dev/null 2>&1; then
|
|
||||||
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m"
|
|
||||||
# Check user is not root (root doesn't have access to user xorg server)
|
# Check user is not root (root doesn't have access to user xorg server)
|
||||||
elif [[ "$USER" == "root" ]]; then
|
if [[ "$USER" == "root" ]]; then
|
||||||
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m"
|
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m"
|
||||||
else
|
else
|
||||||
# If no tty, data should be available on stdin
|
# If no tty, data should be available on stdin
|
||||||
@@ -198,7 +217,7 @@
|
|||||||
echo " echo <string> | cb"
|
echo " echo <string> | cb"
|
||||||
else
|
else
|
||||||
# Copy input to clipboard
|
# Copy input to clipboard
|
||||||
echo -n "$input" | xclip -selection c
|
echo -n "$input" | wl-copy
|
||||||
# Truncate text for status
|
# Truncate text for status
|
||||||
if [ ''${#input} -gt 80 ]; then input="$(echo $input | cut -c1-80)$_trn_col...\e[0m"; fi
|
if [ ''${#input} -gt 80 ]; then input="$(echo $input | cut -c1-80)$_trn_col...\e[0m"; fi
|
||||||
# Print status.
|
# Print status.
|
||||||
@@ -326,7 +345,7 @@
|
|||||||
complete -W "start stop restart status daemon-reload" stl
|
complete -W "start stop restart status daemon-reload" stl
|
||||||
|
|
||||||
# run
|
# run
|
||||||
complete -W "mnt-wechner sync-school wstunnel hibernate p speed-test-nixos-iso speed-test-upload speed-test-download bat bstat mnt-files-local mnt-lan-local mnt-files-remote mnt-lan-remote suspend rm-tab-cur rm-last-char mnt-school" ru
|
complete -W "mnt-wechner sync-school wstunnel hibernate p speed-test-nixos-iso speed-test-upload speed-test-download bat bstat mnt-files-local mnt-lan-local mnt-files-remote mnt-lan-remote suspend rm-tab-cur rm-last-char mnt-school mnt-host" ru
|
||||||
|
|
||||||
|
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"*" = {
|
"*" = {
|
||||||
identityFile = "${secretsDir}/private-key";
|
identityFile = "${secretsDir}/private-key";
|
||||||
};
|
};
|
||||||
pcmc = {
|
ouranos = {
|
||||||
hostname = "195.201.148.94";
|
hostname = "195.201.148.94";
|
||||||
user = "root";
|
user = "root";
|
||||||
};
|
};
|
||||||
@@ -51,6 +51,10 @@
|
|||||||
acern = {
|
acern = {
|
||||||
user = "me";
|
user = "me";
|
||||||
port = 2222;
|
port = 2222;
|
||||||
|
};
|
||||||
|
mosatop = {
|
||||||
|
user = "me";
|
||||||
|
port = 2222;
|
||||||
};
|
};
|
||||||
hpm = {
|
hpm = {
|
||||||
user = "me";
|
user = "me";
|
||||||
|
|||||||
2
scripts/start-wsl.bat
Normal file
2
scripts/start-wsl.bat
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
@echo off
|
||||||
|
wsl --shell-type login -- /bin/sh -c "source /home/me/.bashrc; while true; sleep 9999999; echo hi; done &"
|
||||||
@@ -33,11 +33,10 @@
|
|||||||
|
|
||||||
|
|
||||||
home.file = {
|
home.file = {
|
||||||
".mysecrets/root-pwd".text = "changemehiiii";
|
|
||||||
".mysecrets/me-pwd".text = "changeme";
|
|
||||||
|
|
||||||
#".mozilla/firefox".source = config.lib.file.mkOutOfStoreSymlink "${persistentDir}/firefox";
|
#".mozilla/firefox".source = config.lib.file.mkOutOfStoreSymlink "${persistentDir}/firefox";
|
||||||
".cache/rofi-3.runcache".source = config.lib.file.mkOutOfStoreSymlink "${persistentDir}/rofi-run-cache";
|
".cache/rofi-3.runcache".source = config.lib.file.mkOutOfStoreSymlink "${persistentDir}/rofi-run-cache";
|
||||||
|
|
||||||
|
".local/share/PrismLauncher/".source = config.lib.file.mkOutOfStoreSymlink "${workDir}/app-data/prism-launcher";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -126,7 +125,7 @@
|
|||||||
(pkgs.writeShellApplication {
|
(pkgs.writeShellApplication {
|
||||||
name = "rpi";
|
name = "rpi";
|
||||||
text = let
|
text = let
|
||||||
myPythonRpi = pkgs.writers.writePython3Bin "myPythonRpi" { libraries = [pkgs.python311Packages.dnspython]; } ''
|
myPythonRpi = pkgs.writers.writePython3Bin "myPythonRpi" { libraries = [pkgs.python3Packages.dnspython]; } ''
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|||||||
Reference in New Issue
Block a user