flake-based devshell
This commit is contained in:
parent
8f0c82e8db
commit
fa6a69fe58
10
.envrc
10
.envrc
|
@ -9,6 +9,12 @@ if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; the
|
||||||
echo "$now" > .direnv/pull-date
|
echo "$now" > .direnv/pull-date
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v nixos-rebuild >/dev/null; then
|
if test -s .remote.toml; then
|
||||||
use nix
|
use flake .#remote
|
||||||
|
echo
|
||||||
|
echo "Current remote: $(remote-host)"
|
||||||
|
tomlq <.remote.toml '.hosts | to_entries[] | "remote-set \(.key+1) # -> \(.value.host)"' -r
|
||||||
|
echo
|
||||||
|
elif ! command -v nixos-rebuild >/dev/null; then
|
||||||
|
use flake .#non-nixos
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
* [x] Make a flake
|
* [x] Make a flake
|
||||||
* [x] merge hosted docs into a single subdomain
|
* [x] merge hosted docs into a single subdomain
|
||||||
* [ ] autogenerate ssh keys
|
* [ ] autogenerate ssh keys
|
||||||
|
* [ ] switch to systemd networkd
|
||||||
* [ ] pre-commit hook with 'nix eval ...outPath'
|
* [ ] pre-commit hook with 'nix eval ...outPath'
|
||||||
* [ ] use `nom` when deploying
|
* [ ] use `nom` when deploying
|
||||||
* [ ] figure out how to reuse system flake lock while deplying, leave the night job to upgrade
|
* [ ] figure out how to reuse system flake lock while deplying, leave the night job to upgrade
|
||||||
|
|
|
@ -15,7 +15,7 @@ Via git, build on remote:
|
||||||
|
|
||||||
Via `remote-exec`, build on remote:
|
Via `remote-exec`, build on remote:
|
||||||
|
|
||||||
nix shell .#remote-exec
|
nix develop .#remote
|
||||||
remote-set FOOBAR
|
remote-set FOOBAR
|
||||||
remote sudo nixos-rebuild test --flake . --recreate-lock-file --no-write-lock-file
|
remote sudo nixos-rebuild test --flake . --recreate-lock-file --no-write-lock-file
|
||||||
|
|
||||||
|
|
34
flake.nix
34
flake.nix
|
@ -26,12 +26,15 @@
|
||||||
...
|
...
|
||||||
} @ 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: nixpkgs.lib.genAttrs systems (system: f system);
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
||||||
|
overlays = nixlib.mapAttrsToList (name: val: val) self.overlays;
|
||||||
|
|
||||||
tmpConfig = {
|
tmpConfig = {
|
||||||
disabledModules = [ "services/misc/polaris.nix" ];
|
disabledModules = [ "services/misc/polaris.nix" ];
|
||||||
imports = [ "${inputs.pr-polaris14}/nixos/modules/services/misc/polaris.nix" ];
|
imports = [ "${inputs.pr-polaris14}/nixos/modules/services/misc/polaris.nix" ];
|
||||||
|
@ -67,18 +70,45 @@
|
||||||
})];
|
})];
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
|
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
|
|
||||||
|
overlays.remote-exec = (final: prev: {
|
||||||
|
remote-exec = prev.python3Packages.callPackage ./pkgs/remote-exec.nix {};
|
||||||
|
});
|
||||||
|
|
||||||
|
packages = forAllSystems(system:
|
||||||
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
in { inherit (pkgs) remote-exec; }
|
||||||
|
);
|
||||||
|
|
||||||
nixosConfigurations.noximilien = mkConfig "noximilien" "x86_64-linux" (with nixos-hardware.nixosModules; [ common-pc common-pc-ssd common-cpu-intel ]);
|
nixosConfigurations.noximilien = mkConfig "noximilien" "x86_64-linux" (with nixos-hardware.nixosModules; [ common-pc common-pc-ssd common-cpu-intel ]);
|
||||||
nixosConfigurations.bolle = mkConfig "bolle" "x86_64-linux" (with nixos-hardware.nixosModules; [ common-pc common-pc-ssd common-cpu-intel ]);
|
nixosConfigurations.bolle = mkConfig "bolle" "x86_64-linux" (with nixos-hardware.nixosModules; [ common-pc common-pc-ssd common-cpu-intel ]);
|
||||||
nixosConfigurations.nord = mkConfig "nord" "x86_64-linux" (with nixos-hardware.nixosModules; [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-amd ]);
|
nixosConfigurations.nord = mkConfig "nord" "x86_64-linux" (with nixos-hardware.nixosModules; [ common-pc common-pc-ssd common-cpu-intel-cpu-only common-gpu-amd ]);
|
||||||
|
|
||||||
homeConfigurations = forAllSystems (system: {
|
homeConfigurations = forAllSystems (system: {
|
||||||
pbsds = home-manager.lib.homeManagerConfiguration {
|
pbsds = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
modules = [ ./users/pbsds/home ];
|
modules = [ ./users/pbsds/home ];
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
devShells = forAllSystems (system: {
|
|
||||||
default = nixpkgs.legacyPackages.${system}.callPackage ./shell.nix { };
|
devShells = forAllSystems (system: { # TODO: apply my overlays?
|
||||||
|
non-nixos = nixpkgs.legacyPackages.${system}.mkShell {
|
||||||
|
packages = with nixpkgs.legacyPackages.${system}; [
|
||||||
|
nix-output-monitor
|
||||||
|
nixos-rebuild
|
||||||
|
home-manager
|
||||||
|
];
|
||||||
|
};
|
||||||
|
remote = nixpkgs.legacyPackages.${system}.mkShell {
|
||||||
|
packages = with nixpkgs.legacyPackages.${system}; [
|
||||||
|
nix-output-monitor
|
||||||
|
self.packages.${system}.remote-exec
|
||||||
|
yq
|
||||||
|
];
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
#supportedFeatures:
|
# supportedFeatures:
|
||||||
# - "kvm" - has hypervisor
|
# - "kvm" - has hypervisor
|
||||||
# - "nixos-test" - the same as ^? nixos?
|
# - "nixos-test" - the same as ^? nixos?
|
||||||
# - "benchmark" - has "equal" performance
|
# - "benchmark" - has "equal" performance
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
pkgs.mkShell {
|
|
||||||
packages = with pkgs; [
|
|
||||||
#buildInputs = with pkgs; [
|
|
||||||
nixos-rebuild
|
|
||||||
home-manager
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,5 +1,7 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
#home.packages = with pkgs; [ mpv ];
|
||||||
|
|
||||||
programs.mpv.enable = true;
|
programs.mpv.enable = true;
|
||||||
programs.mpv.bindings."n" = "sub-seek 1";
|
programs.mpv.bindings."n" = "sub-seek 1";
|
||||||
programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
|
programs.mpv.bindings."SHIFT+n" = "sub-seek -1";
|
||||||
|
|
|
@ -84,6 +84,4 @@
|
||||||
complete -F _command tldr
|
complete -F _command tldr
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue