flakes fixes

auto-flake-update
Yorick van Pelt 2022-05-15 15:39:25 +02:00
parent 407905d7dc
commit 0bcc8b3c52
Signed by: yorick
GPG Key ID: A36E70F9DC014A15
10 changed files with 59 additions and 68 deletions

View File

@ -1,6 +0,0 @@
{
allowUnfree = true;
# chromium.vaapiSupport = true;
android_sdk.accept_license = true;
overlays = import ./overlays.nix;
}

View File

@ -10,28 +10,39 @@
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-21.05"; nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-21.05";
nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs"; nixos-mailserver.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = inputs@{ nixpkgs, home-manager, nixpkgs-mozilla, emacs-overlay, nixpkgs-wayland, nixpkgs-stable, nixos-hardware, self, ... }: { outputs = inputs@{ nixpkgs, home-manager, nixpkgs-mozilla, emacs-overlay
overlays.default = [ , nixpkgs-wayland, nixpkgs-stable, nixos-hardware, self, ... }: {
overlay = nixpkgs.lib.composeManyExtensions [
nixpkgs-wayland.overlay nixpkgs-wayland.overlay
nixpkgs-mozilla.overlay #nixpkgs-mozilla.overlay
emacs-overlay.overlay emacs-overlay.overlay
(import ./fixups.nix) (import ./fixups.nix)
(import ./pkgs) (import ./pkgs)
(import ./pkgs/mdr.nix) (import ./pkgs/mdr.nix)
(import ./nixos/overlay.nix)
(final: prev: { (final: prev: {
stable = nixpkgs-stable.legacyPackages.x86_64-linux; nixpkgs-stable = import nixpkgs-stable {
system = prev.stdenv.system;
config = { };
overlays = [ ];
};
flake-inputs = inputs; flake-inputs = inputs;
}) })
(import ./nixos/overlay.nix)
]; ];
legacyPackages.x86_64-linux = import nixpkgs { legacyPackages.x86_64-linux = import nixpkgs {
config = import ./config.nix; config = {
allowUnfree = true;
# chromium.vaapiSupport = true;
android_sdk.accept_license = true;
};
system = "x86_64-linux"; system = "x86_64-linux";
overlays = self.overlays.default; overlays = [ self.overlay ];
}; };
nixosConfigurations = self.legacyPackages.x86_64-linux.yorick.machine; nixosConfigurations = self.legacyPackages.x86_64-linux.yorick.machine;
homeConfigurations.yorick = home-manager.lib.homeManagerConfiguration { homeConfigurations.x86_64-linux =
home-manager.lib.homeManagerConfiguration {
pkgs = self.legacyPackages.x86_64-linux; pkgs = self.legacyPackages.x86_64-linux;
configuration = import ./home-manager/home.nix; configuration = import ./home-manager/home.nix;
system = "x86_64-linux"; system = "x86_64-linux";
@ -39,7 +50,8 @@
stateVersion = "20.09"; stateVersion = "20.09";
homeDirectory = "/home/yorick"; homeDirectory = "/home/yorick";
}; };
packages.x86_64-linux.yorick-home = self.homeConfigurations.yorick.activationPackage; packages.x86_64-linux.yorick-home =
self.homeConfigurations.x86_64-linux.activationPackage;
}; };
} }

View File

@ -8,6 +8,7 @@ let
in { in {
imports = [ ./desktop.nix ./emacs.nix ./lumi.nix ]; imports = [ ./desktop.nix ./emacs.nix ./lumi.nix ];
programs = { programs = {
nix-index.enable = true;
starship = { starship = {
enable = true; enable = true;
settings.nix_shell.disabled = false; settings.nix_shell.disabled = false;
@ -111,7 +112,7 @@ in {
enable = true; enable = true;
historyControl = [ "erasedups" "ignoredups" "ignorespace" ]; historyControl = [ "erasedups" "ignoredups" "ignorespace" ];
shellAliases = { shellAliases = {
nr = ''nix repl "<nixpkgs>"''; nr = ''nix repl "/home/yorick/dotfiles/repl.nix"'';
nsp = "nix-shell -p"; nsp = "nix-shell -p";
}; };
initExtra = '' initExtra = ''
@ -125,10 +126,10 @@ in {
}; };
}; };
xdg.configFile."nixpkgs/config.nix".text = '' xdg.configFile."nixpkgs/config.nix".text = ''
import "${toString ../config.nix}" throw "tried to read nixpkgs/config.nix"
''; '';
xdg.configFile."nixpkgs/overlays.nix".text = '' xdg.configFile."nixpkgs/overlays.nix".text = ''
import "${toString ../overlays.nix}" throw "tried to read nixpkgs/overlays.nix"
''; '';
xdg.configFile."streamlink/config".text = '' xdg.configFile."streamlink/config".text = ''
player = mpv --cache 2048 player = mpv --cache 2048
@ -285,6 +286,6 @@ in {
recursive = true; recursive = true;
}; };
home.sessionVariables = { home.sessionVariables = {
FLAKE_CONFIG_URI = "/home/yorick/dotfiles#homeConfigurations.yorick"; FLAKE_CONFIG_URI = "/home/yorick/dotfiles#homeConfigurations.${pkgs.stdenv.system}.activationPackage";
}; };
} }

View File

@ -4,6 +4,7 @@
imports = [ ../physical/x11.nix ../roles/workstation.nix ]; imports = [ ../physical/x11.nix ../roles/workstation.nix ];
yorick.lumi-vpn.enable = lib.mkForce false; yorick.lumi-vpn.enable = lib.mkForce false;
yorick.lumi-cache.enable = lib.mkForce false;
system.stateVersion = "21.05"; system.stateVersion = "21.05";
} }

View File

@ -2,9 +2,8 @@
{ {
imports = [ imports = [
./. ./.
inputs.nixos-hardware.nixosModules.common-cpu-amd;
./3950x-hardware-config.nix ./3950x-hardware-config.nix
"${sources.nixos-hardware}/common/cpu/amd" inputs.nixos-hardware.nixosModules.common-cpu-amd
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, inputs, ... }: { config, lib, pkgs, inputs, ... }:
{ {
imports = [ imports = [
inputs.nixos-hardware.nixosModules.dell-xps-13-9360; inputs.nixos-hardware.nixosModules.dell-xps-13-9360
./xps9360-hardware-config.nix ./xps9360-hardware-config.nix
]; ];

View File

@ -1,5 +1,5 @@
let secrets = import ../secrets.nix; let secrets = import ../secrets.nix;
in { config, pkgs, lib, name, ... }: in { config, pkgs, lib, name, inputs, ... }:
let let
machine = name; machine = name;
vpn = import ../vpn.nix; vpn = import ../vpn.nix;
@ -13,7 +13,8 @@ in {
../services ../services
]; ];
nix.nixPath = [ "nixpkgs=${pkgs.path}" ]; nix.nixPath = [];# "nixpkgs=${pkgs.path}" ];
nix.registry.nixpkgs.flake = inputs.nixpkgs;
networking.domain = "yori.cc"; networking.domain = "yori.cc";
networking.hostName = machine; networking.hostName = machine;

23
nr.fish
View File

@ -32,28 +32,7 @@ function :u
end end
for arg in $argv for arg in $argv
set -l out (nix-instantiate --eval --json --expr ' nix build -L $argv --no-link && set -l out (nix eval --raw $argv)
let
tryImport = f: with builtins; let v = import f; in if isFunction v && (any (a: a) (attrValues (functionArgs v))) then v {} else v;
isImportable = path: with builtins; if pathExists "${path}/" then pathExists "${path}/default.nix" else pathExists "${path}";
pathBits = with builtins; map ({ prefix, path }:
if prefix == "" then
let
contents = readDir path;
names = builtins.filter (a: contents.${a} == "directory" && isImportable "${path}/${a}") (attrNames contents);
in
foldl\' (prev: val: prev // { ${val} = tryImport "${path}/${val}"; }) {} names
else
if isImportable path then
{ ${prefix} = tryImport path; }
else
{ }
) nixPath;
out = builtins.foldl\' (old: new: old // new) {} pathBits;
in with out; builtins.toPath ('"$arg"').outPath' | jq -r .)
[ -e $out ] || nix-store -r $out > /dev/null
__nr_apply $out __nr_apply $out
end end
end end

View File

@ -4,7 +4,7 @@
ftb = super.callPackage ./ftb.nix {}; ftb = super.callPackage ./ftb.nix {};
# todo: python 2 -> 3 # todo: python 2 -> 3
pyroscope = self.stable.callPackage ./pyroscope {}; pyroscope = self.nixpkgs-stable.callPackage ./pyroscope {};
yscripts = super.callPackage ../bin {}; yscripts = super.callPackage ../bin {};
factorio = super.factorio.override { factorio = super.factorio.override {

4
repl.nix Normal file
View File

@ -0,0 +1,4 @@
let flake = builtins.getFlake (toString ./.);
in {
inherit flake;
} // flake.legacyPackages.${builtins.currentSystem} // flake.nixosConfigurations