ljdsalkjdsalkj

This commit is contained in:
Peder Bergebakken Sundt 2023-06-24 20:23:38 +02:00
parent a2ab641f72
commit cbd38fc8f4
6 changed files with 38 additions and 12 deletions

View File

@ -42,13 +42,12 @@
... ...
} @ inputs: } @ inputs:
let let
nixlib = nixpkgs.lib;
systems = [ systems = [
"x86_64-linux" "x86_64-linux"
"aarch64-linux" "aarch64-linux"
#"riscv64-linux" #"riscv64-linux"
]; ];
forAllSystems = f: nixlib.genAttrs systems (system: f { forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f {
inherit system; inherit system;
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
lib = nixpkgs.legacyPackages.${system}.lib; lib = nixpkgs.legacyPackages.${system}.lib;
@ -64,7 +63,7 @@
remote-exec = prev.python3Packages.callPackage "${inputs.pr-remote-exec}/pkgs/tools/misc/remote-exec" { }; remote-exec = prev.python3Packages.callPackage "${inputs.pr-remote-exec}/pkgs/tools/misc/remote-exec" { };
})]; })];
}; };
mkConfig = hostname: domain: system: modules: nixlib.nixosSystem { mkConfig = hostname: domain: system: modules: nixpkgs.lib.nixosSystem {
inherit system; inherit system;
specialArgs = { specialArgs = {
inherit inputs; inherit inputs;

View File

@ -27,7 +27,7 @@
../../profiles/shell/base.nix ../../profiles/shell/base.nix
../../profiles/shell/archives.nix ../../profiles/shell/archives.nix
../../profiles/shell/nix-utils.nix ../../profiles/shell/nix-utils.nix
#../../profiles/shell/binfmt-emu.nix ../../profiles/shell/binfmt-emu.nix
../../profiles/desktop/gnome # configures gdm ../../profiles/desktop/gnome # configures gdm
#../../profiles/desktop/sound/alsa.nix #../../profiles/desktop/sound/alsa.nix

View File

@ -32,7 +32,7 @@
../../profiles/shell/base.nix ../../profiles/shell/base.nix
../../profiles/shell/archives.nix ../../profiles/shell/archives.nix
../../profiles/shell/nix-utils.nix ../../profiles/shell/nix-utils.nix
#../../profiles/shell/binfmt-emu.nix ../../profiles/shell/binfmt-emu.nix
../../profiles/desktop/gnome # configures gdm ../../profiles/desktop/gnome # configures gdm
#../../profiles/desktop/sound/alsa.nix #../../profiles/desktop/sound/alsa.nix
@ -117,6 +117,15 @@
noto-fonts-extra noto-fonts-extra
]; ];
# nvidia bad
nixpkgs.config.packageOverrides = (pkgs: {
element-desktop = pkgs.element-desktop.overrideAttrs (old: {
desktopItem = old.desktopItem.override (old: {
exec = "element-desktop --in-process-gpu --disable-gpu %u";
});
});
});
# Enable touchpad support (enabled default in most desktopManager). # Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true; # services.xserver.libinput.enable = true;

View File

@ -55,11 +55,25 @@ let
/** / /** /
{ {
systems = [ "x86_64-linux" "wasm32-wasi" "wasm64-wasi" "x86_64-windows" "aarch64-linux" "riscv64-linux" ]; systems = [ "x86_64-linux" "wasm32-wasi" "wasm64-wasi" "x86_64-windows" "aarch64-linux" "riscv64-linux" ];
hostName = "nord.pbsds.net"; # TODO: port 24 hostName = "sopp.pbsds.net";
sshPort = 26;
sshUser = "pbsds";
maxJobs = 4; # 8 cores
#maxJobs = 1; # at least for big-parallel
speedFactor = 2;
supportedFeatures = [ "kvm" "big-parallel" "nixos-test" ];
#mandatoryFeatures = [ ];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDYB9H1pHB1vTBiGhO/GCQjn70BtVdQuJyXx38zN2CDj";
}
/**/
{
systems = [ "x86_64-linux" "wasm32-wasi" "wasm64-wasi" "x86_64-windows" "aarch64-linux" "riscv64-linux" ];
hostName = "nord.pbsds.net";
sshPort = 24;
sshUser = "pbsds"; sshUser = "pbsds";
maxJobs = 2; # 4 cores maxJobs = 2; # 4 cores
#maxJobs = 1; # at least for big-parallel #maxJobs = 1; # at least for big-parallel
speedFactor = 2; speedFactor = 1;
supportedFeatures = [ "kvm" "big-parallel" "nixos-test" ]; supportedFeatures = [ "kvm" "big-parallel" "nixos-test" ];
#mandatoryFeatures = [ ]; #mandatoryFeatures = [ ];
publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBSdIUtUfAxnVbPDmDDFdP2S3Wd3+CC8IfZAANJ76oh"; publicKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIBSdIUtUfAxnVbPDmDDFdP2S3Wd3+CC8IfZAANJ76oh";
@ -95,10 +109,11 @@ let
mkRemoteConfig = { mkRemoteConfig = {
publicKey,# fetch it with `ssh-keyscan` publicKey,# fetch it with `ssh-keyscan`
proxy ? null, # schema: { user, host, publicKey } proxy ? null, # schema: { user, host, publicKey }
sshPort ? 22,
... # the rest follows nix.buildMachines.<NAME> schema ... # the rest follows nix.buildMachines.<NAME> schema
}@args: }@args:
let let
buildMachine = lib.filterAttrs (key: _: !builtins.elem key ["publicKey" "proxy"]) args; # this should have syntactic sugar: ...@buildMachine buildMachine = lib.filterAttrs (key: _: !builtins.elem key ["publicKey" "proxy" "sshPort"]) args; # this should have syntactic sugar: ...@buildMachine
filter = lib.mkIf (buildMachine.hostName != config.networking.fqdn); filter = lib.mkIf (buildMachine.hostName != config.networking.fqdn);
in filter { in filter {
nix.buildMachines = [ buildMachine ]; nix.buildMachines = [ buildMachine ];
@ -108,6 +123,7 @@ let
programs.ssh.extraConfig = '' programs.ssh.extraConfig = ''
Host ${buildMachine.hostName} Host ${buildMachine.hostName}
ConnectTimeout 3 ConnectTimeout 3
Port ${builtins.toString sshPort}
${lib.optionalString (proxy != null) '' ${lib.optionalString (proxy != null) ''
ProxyJump ${proxy.user}@${proxy.host} ProxyJump ${proxy.user}@${proxy.host}
''} ''}

View File

@ -25,7 +25,8 @@
# TODO: remove # TODO: remove
function atom_nix { function atom_nix {
#nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox" #nix-shell -p atom --run "atom $(printf "%q " "$@") --in-process-gpu --no-sandbox"
nix-shell -p atom --run "atom $(printf "%q " "$@") --no-sandbox" #nix-shell -p atom --run "atom $(printf "%q " "$@") --no-sandbox"
nix run nixpkgs#atom -- --disable-gpu --in-process-gpu --no-sandbox "$@"
} }
''; '';
@ -124,7 +125,8 @@
killall = "killall -v"; killall = "killall -v";
bin = "perl -pe 'chomp' | curl -is -X POST https://i.kuklef.se/upload -F content=@- -F expiration=10d | grep '^location:' | cut -d' ' -f2-"; bin = "perl -pe 'chomp' | curl -is -X POST https://i.kuklef.se/upload -F content=@- -F expiration=10d | grep '^location:' | cut -d' ' -f2-";
atom = "atom --no-sandbox"; #atom = "atom --no-sandbox";
atom = "atom --disable-gpu --in-process-gpu --no-sandbox";
}; };
programs.nix-index.enable = true; programs.nix-index.enable = true;

View File

@ -51,7 +51,7 @@ in {
} }
function marks { function marks {
#ls -l "$_JUMP_MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo #ls -l "$_JUMP_MARKPATH" | sed 's/ / /g' | cut -d' ' -f9- | sed 's/ -/\t-/g' && echo
ls --color=always -l "$_JUMP_MARKPATH" | tr -s ' ' | cut -d' ' -f9- | sed -e 's/ -> /§/g' | column -t -s '§' -o ' -> ' command ls --color=always -l "$_JUMP_MARKPATH" | tr -s ' ' | cut -d' ' -f9- | sed -e 's/ -> /§/g' | column -t -s '§' -o ' -> '
} }
_complete_jump_marks() { _complete_jump_marks() {
local curw=''${COMP_WORDS[COMP_CWORD]} local curw=''${COMP_WORDS[COMP_CWORD]}