again too lazy to sort out changes

This commit is contained in:
Sebastian Moser
2023-11-17 12:15:40 +01:00
parent 3ef7f87cfb
commit fd353abb94
11 changed files with 221 additions and 22 deletions

View File

@@ -11,7 +11,7 @@
home-manager.extraSpecialArgs = specialArgs; home-manager.extraSpecialArgs = specialArgs;
programs.dconf.enable = true; programs.dconf.enable = true;
# set root user pwd # set root user pwd
users.users.root.password = "changeme"; users.users.root.password = "changeme";
@@ -21,20 +21,20 @@
# add mybin to path # add mybin to path
environment.etc.profile.text = '' environment.etc.profile.text = ''
export PATH=$PATH:${self}/mybin export PATH=$PATH:${self}/mybin
''; '';
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
home-manager.backupFileExtension = "backup"; home-manager.backupFileExtension = "backup";
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
users.mutableUsers = true; users.mutableUsers = true;
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default

98
flake.lock generated
View File

@@ -3,8 +3,8 @@
"androidPkgs": { "androidPkgs": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
"flake-utils": "flake-utils_4", "flake-utils": "flake-utils_5",
"nixpkgs": "nixpkgs_4" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1638562808, "lastModified": 1638562808,
@@ -251,6 +251,22 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@@ -306,6 +322,24 @@
} }
}, },
"flake-utils_4": { "flake-utils_4": {
"inputs": {
"systems": "systems_4"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_5": {
"locked": { "locked": {
"lastModified": 1638122382, "lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
@@ -515,6 +549,26 @@
"type": "github" "type": "github"
} }
}, },
"nix-wsl": {
"inputs": {
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_4",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1700096639,
"narHash": "sha256-FVOTqjwjLX4El7n3jErrWWQ4gR5NVcL7B8cvGRGFQSo=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "83ce0dbe362b9b866414bbc31a2dc9f1d41be649",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NixOS-WSL",
"type": "github"
}
},
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1693701915, "lastModified": 1693701915,
@@ -630,6 +684,22 @@
} }
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": {
"lastModified": 1697851979,
"narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5550a85a087c04ddcace7f892b0bdc9d8bb080c8",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1699191053, "lastModified": 1699191053,
"narHash": "sha256-S/J3x3CiT09ywrdE17IueZz+BX/qBqMYTjJmOqg8WPY=", "narHash": "sha256-S/J3x3CiT09ywrdE17IueZz+BX/qBqMYTjJmOqg8WPY=",
@@ -645,7 +715,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_4": { "nixpkgs_5": {
"locked": { "locked": {
"lastModified": 1637841632, "lastModified": 1637841632,
"narHash": "sha256-QYqiKHdda0EOnLGQCHE+GluD/Lq2EJj4hVTooPM55Ic=", "narHash": "sha256-QYqiKHdda0EOnLGQCHE+GluD/Lq2EJj4hVTooPM55Ic=",
@@ -661,7 +731,7 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_5": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1638371214, "lastModified": 1638371214,
"narHash": "sha256-0kE6KhgH7n0vyuX4aUoGsGIQOqjIx2fJavpCWtn73rc=", "narHash": "sha256-0kE6KhgH7n0vyuX4aUoGsGIQOqjIx2fJavpCWtn73rc=",
@@ -792,7 +862,7 @@
"robotnix": { "robotnix": {
"inputs": { "inputs": {
"androidPkgs": "androidPkgs", "androidPkgs": "androidPkgs",
"nixpkgs": "nixpkgs_5", "nixpkgs": "nixpkgs_6",
"nixpkgsUnstable": "nixpkgsUnstable" "nixpkgsUnstable": "nixpkgsUnstable"
}, },
"locked": { "locked": {
@@ -816,8 +886,9 @@
"nix-doom-emacs": "nix-doom-emacs", "nix-doom-emacs": "nix-doom-emacs",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nix-wsl": "nix-wsl",
"nixos-generators": "nixos-generators", "nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs_3", "nixpkgs": "nixpkgs_4",
"nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap",
"robotnix": "robotnix" "robotnix": "robotnix"
} }
@@ -899,6 +970,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_4": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"ts-fold": { "ts-fold": {
"flake": false, "flake": false,
"locked": { "locked": {

View File

@@ -43,6 +43,8 @@
# note: when updating nixpkgs-for-bootstrap, update store paths of proot-termux in modules/environment/login/default.nix # note: when updating nixpkgs-for-bootstrap, update store paths of proot-termux in modules/environment/login/default.nix
nixpkgs-for-bootstrap.url = "github:NixOS/nixpkgs/c7ff1b9b95620ce8728c0d7bd501c458e6da9e04"; nixpkgs-for-bootstrap.url = "github:NixOS/nixpkgs/c7ff1b9b95620ce8728c0d7bd501c458e6da9e04";
nix-wsl.url = "github:nix-community/NixOS-WSL";
}; };
outputs = { self, nixpkgs, ... }@inputs: outputs = { self, nixpkgs, ... }@inputs:
@@ -118,6 +120,26 @@
"wsl" = nixpkgs.lib.nixosSystem { "wsl" = nixpkgs.lib.nixosSystem {
inherit specialArgs; inherit specialArgs;
system = "x86_64-linux"; system = "x86_64-linux";
modules = [
inputs.nix-wsl.nixosModules.wsl
{
wsl.enable = true;
services.openssh = {
enable = true;
settings.PasswordAuthentication = false;
settings.KbdInteractiveAuthentication = false;
};
users.users.nixos.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFjgXf9S9hxjyph2EEFh1el0z4OUT9fMoFAaDanjiuKa me@main"
]
programs.bash.loginShellInit = "nixos-wsl-welcome";
}
./common/all.nix
];
}; };
"the-most-default" = nixpkgs.lib.nixosSystem { "the-most-default" = nixpkgs.lib.nixosSystem {
@@ -163,17 +185,24 @@
packages.x86_64-linux = { packages.x86_64-linux = {
cbm = nixpkgs.legacyPackages.x86_64-linux.callPackage ./mods/cbm.nix { }; cbm = nixpkgs.legacyPackages.x86_64-linux.callPackage ./mods/cbm.nix { };
supabase = nixpkgs.legacyPackages.x86_64-linux.callPackage ./mods/supabase.nix { };
#default... TODO #default... TODO
run-vm = specialArgs.pkgs.writeScriptBin "run-vm" '' run-vm = specialArgs.pkgs.writeScriptBin "run-vm" ''
${self.nixosConfigurations.hpm.config.system.build.vm}/bin/run-hpm-vm -m 4G -cpu host -smp 4 ${self.nixosConfigurations.hpm.config.system.build.vm}/bin/run-hpm-vm -m 4G -cpu host -smp 4
''; '';
#wsl = inputs.nix-wsl.nixosConfigurations.modern.config.system.build.tarballBuilder;
}; };
apps.x86_64-linux = { apps.x86_64-linux = {
default = { wsl = {
type = "app"; type = "app";
program = "${self.packages.x86_64-linux.run-vm}/bin/run-vm"; program = "${self.nixosConfigurations.wsl.config.system.build.tarballBuilder}/bin/nixos-wsl-tarball-builder";
}; };
default = {
type = "app";
program = "${self.packages.x86_64-linux.run-vm}/bin/run-vm";
};
}; };
}; };
} }

View File

@@ -20,6 +20,13 @@
../users/root/default.nix ../users/root/default.nix
]; ];
services.avahi.enable = true;
environment.systemPackages = with pkgs; [
cifs-utils
ntfs3g
];
virtualisation.podman.enable = true; virtualisation.podman.enable = true;
hardware.bluetooth.settings = { hardware.bluetooth.settings = {
General = { General = {
@@ -168,7 +175,10 @@
mkdir -p /var/lib/libvirt/storage mkdir -p /var/lib/libvirt/storage
ln -nsf ${workDir}/vm/libvirt/my-image-pool.xml /var/lib/libvirt/storage/my-image-pool.xml ln -nsf ${workDir}/vm/libvirt/my-image-pool.xml /var/lib/libvirt/storage/my-image-pool.xml
rm -rf /var/lib/libvirt/qemu/networks rm -rf /var/lib/libvirt/qemu/networks
ln -nsf ${workDir}/vm/qemu/* /var/lib/libvirt/qemu/ ls ${workDir}/vm/qemu | while read path
do
ln -nsf ${workDir}/vm/qemu/$path /var/lib/libvirt/qemu/$path
done
# there is no /bin/bash # there is no /bin/bash
# https://discourse.nixos.org/t/add-bin-bash-to-avoid-unnecessary-pain/5673 # https://discourse.nixos.org/t/add-bin-bash-to-avoid-unnecessary-pain/5673

View File

@@ -7,5 +7,8 @@
#xdg-desktop-portal-termfilechooser = (pkgs.callPackage ../../mods/xdg-desktop-portal-termfilechooser/default.nix {}); #xdg-desktop-portal-termfilechooser = (pkgs.callPackage ../../mods/xdg-desktop-portal-termfilechooser/default.nix {});
#firefox = inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin; #firefox = inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin;
#} #}
#{
#supabase-cli = pkgs.callPackage ./supabase.nix;
#}
]; ];
} }

58
mods/supabase.nix Normal file
View File

@@ -0,0 +1,58 @@
{ stdenv
, autoPatchelfHook
, dpkg
, makeWrapper
, wrapGAppsHook
, libgee
, json-glib
, openldap
, gtksourceview4
, fetchurl
, libsecret
, gtksourceview
,
... }:
stdenv.mkDerivation {
name = "supabase-cli";
src = fetchurl {
url = "https://github.com/supabase/cli/releases/download/v1.111.3/supabase_1.111.3_linux_amd64.deb";
sha256 = "sha256-mrqM1IoKENbf+ZvCMx/GZIpUteDUy4hOxbYQwXXlNpc=";
};
#sourceRoot = "opt/tableplus";
unpackPhase = ''
runHook preUnpack
dpkg-deb -x $src .
runHook postUnpack
'';
installPhase = ''
runHook preInstall
echo hiiiiiiiiiiiiiiiiiiiiiiiii
echo $(pwd)
ls -la usr/bin
mkdir -p "$out/bin"
cp usr/bin/supabase $out/bin
chmod -R g-w "$out"
runHook postInstall
'';
nativeBuildInputs = [
autoPatchelfHook
dpkg
makeWrapper
wrapGAppsHook
];
buildInputs = [
stdenv.cc.cc.lib
libgee
json-glib
openldap
gtksourceview4
libsecret
gtksourceview
];
}

View File

@@ -27,6 +27,8 @@ fi
if [ "$1" == "ignore" ] if [ "$1" == "ignore" ]
echo hello
exit
then then
if [ -t 0 ] if [ -t 0 ]
then then
@@ -36,8 +38,9 @@ then
cat >> ./svn-ignore cat >> ./svn-ignore
fi fi
# do if no or some pipe ... apply the things in the svn-ignore file # do if no or some pipe ... apply the things in the svn-ignore file
cat ./svn-ignore | tr -d '"' | sed 's/$/\/../' | xargs svn propdel svn:ignore 1>/null cat ./svn-ignore | sed 's/$/\/../' | while read p; do svn propdel svn:ignore $p 1>/dev/null; done
cat ./svn-ignore | tr -d '"' | sed 's\^\./\' | while read p; do
cat ./svn-ignore | sed 's\^\./\' | while read p; do
name=$(echo -en "$p" | tr "/" "\n" | tail -n 1) name=$(echo -en "$p" | tr "/" "\n" | tail -n 1)
path=${p%/*} path=${p%/*}
prop=$(svn propget svn:ignore $path) prop=$(svn propget svn:ignore $path)

View File

@@ -71,6 +71,11 @@ then
sudo systemctl hibernate sudo systemctl hibernate
elif [ "$1" == "suspend" ]
then
sudo systemctl suspend
fi fi

View File

@@ -1,4 +1,4 @@
{ persistentDir, confDir, hostname, ... }: { persistentDir, confDir, hostname, self, ... }:
{ {
programs.bash = { programs.bash = {
@@ -69,6 +69,7 @@
}; };
bashrcExtra = '' bashrcExtra = ''
export PATH=${self}/mybin:$PATH
export TERM="xterm-color" export TERM="xterm-color"
# my prompt # my prompt
@@ -273,7 +274,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 bat bstat mnt-files-local mnt-lan-local mnt-files-remote mnt-lan-remote" ru complete -W "mnt-wechner sync-school wstunnel hibernate p speed-test-nixos-iso bat bstat mnt-files-local mnt-lan-local mnt-files-remote mnt-lan-remote suspend" ru
''; '';

View File

@@ -1,4 +1,4 @@
{ pkgs, secretsDir, inputs, config, ... }: { pkgs, secretsDir, inputs, config, self, ... }:
{ {
users.users.me = { users.users.me = {
isNormalUser = true; isNormalUser = true;
@@ -10,6 +10,7 @@
#home-manager._module.args = { inherit inputs; }; #home-manager._module.args = { inherit inputs; };
home-manager.users.me = import ./home.nix; home-manager.users.me = import ./home.nix;
home-manager.extraSpecialArgs = { home-manager.extraSpecialArgs = {
inherit self;
hostname = config.networking.hostName; hostname = config.networking.hostName;
}; };

View File

@@ -112,6 +112,9 @@
xorg.xmodmap xorg.xmodmap
android-studio android-studio
# my own packages
supabase-cli
inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin
# python.... # python....