Merge branch 'main' into cosmic
This commit is contained in:
commit
b3550dc00a
21 changed files with 363 additions and 96 deletions
|
@ -47,5 +47,5 @@ let
|
||||||
type != "unknown" && builtins.baseNameOf path != ".git" && !matchesGitIgnore path
|
type != "unknown" && builtins.baseNameOf path != ".git" && !matchesGitIgnore path
|
||||||
) ./.;
|
) ./.;
|
||||||
in
|
in
|
||||||
if !(evaluatingInStore) then import selfInStore
|
if !(evaluatingInStore) then { ... }@args: import selfInStore ({ selfPath = selfInStore; } // args )
|
||||||
else import ./outputs.nix
|
else { ... }@args: import ./outputs.nix ({ selfPath = selfInStore; } // args)
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
{ inputs, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
../nix-os/core.nix
|
|
||||||
../nix-os/core-desktop.nix
|
|
||||||
../nix-os/nvidia.nix
|
|
||||||
../nix-os/docker.nix
|
|
||||||
../nix-os/razer.nix
|
|
||||||
../nix-os/desktopManagers/gnome.nix
|
|
||||||
../nix-os/displayManagers/gdm.nix
|
|
||||||
#../nix-os/desktop/kde-plasma.nix
|
|
||||||
../nix-os/shell.nix
|
|
||||||
../nix-os/virtualization.nix
|
|
||||||
../nix-os/polkit/disable-shutdown.nix
|
|
||||||
../nix-os/locale.nix
|
|
||||||
../nix-os/adb.nix
|
|
||||||
../nix-os/account.nix
|
|
||||||
../nix-os/xdg-default-apps.nix
|
|
||||||
../nix-os/services/nix-binary-cache.nix
|
|
||||||
../nix-os/udev.nix
|
|
||||||
|
|
||||||
"${inputs.nixos-vscode-server}"
|
|
||||||
];
|
|
||||||
|
|
||||||
config = {
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
|
|
||||||
networking.hostName = "wroclaw-main";
|
|
||||||
|
|
||||||
services.xrdp.enable = true;
|
|
||||||
users.groups."tsusers".members = [ "wroclaw" ];
|
|
||||||
|
|
||||||
services.printing.drivers = with pkgs; [
|
|
||||||
hplip
|
|
||||||
];
|
|
||||||
|
|
||||||
# nixos-vscode-server module needs this
|
|
||||||
programs.nix-ld.enable = true;
|
|
||||||
services.vscode-server = {
|
|
||||||
enable = true;
|
|
||||||
extraRuntimeDependencies = with pkgs; [
|
|
||||||
docker
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.printing.startWhenNeeded = false;
|
|
||||||
|
|
||||||
system.stateVersion = "23.05";
|
|
||||||
};
|
|
||||||
}
|
|
64
hosts/main/default.nix
Normal file
64
hosts/main/default.nix
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
{ inputs, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
../../nix-os/core.nix
|
||||||
|
../../nix-os/core-desktop.nix
|
||||||
|
../../nix-os/nvidia.nix
|
||||||
|
../../nix-os/docker.nix
|
||||||
|
../../nix-os/razer.nix
|
||||||
|
../../nix-os/desktopManagers/gnome.nix
|
||||||
|
../../nix-os/displayManagers/gdm.nix
|
||||||
|
../../nix-os/shell.nix
|
||||||
|
../../nix-os/virtualization.nix
|
||||||
|
../../nix-os/polkit/disable-shutdown.nix
|
||||||
|
../../nix-os/locale.nix
|
||||||
|
../../nix-os/adb.nix
|
||||||
|
../../nix-os/account.nix
|
||||||
|
../../nix-os/xdg-default-apps.nix
|
||||||
|
../../nix-os/services/nix-binary-cache.nix
|
||||||
|
../../nix-os/udev.nix
|
||||||
|
../../nix-os/gnupg.nix
|
||||||
|
|
||||||
|
"${inputs.nixos-vscode-server}"
|
||||||
|
];
|
||||||
|
|
||||||
|
config = {
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "wroclaw-main";
|
||||||
|
|
||||||
|
services.xrdp.enable = true;
|
||||||
|
users.groups."tsusers".members = [ "wroclaw" ];
|
||||||
|
|
||||||
|
services.printing.drivers = with pkgs; [
|
||||||
|
hplip
|
||||||
|
];
|
||||||
|
|
||||||
|
# nixos-vscode-server module needs this
|
||||||
|
programs.nix-ld.enable = true;
|
||||||
|
services.vscode-server = {
|
||||||
|
enable = true;
|
||||||
|
extraRuntimeDependencies = with pkgs; [
|
||||||
|
docker
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.pipewire.wireplumber.configPackages = [(
|
||||||
|
pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
name = "wireplumber-config";
|
||||||
|
src = ./wireplumber;
|
||||||
|
phases = [ "installPhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/wireplumber/wireplumber.conf.d
|
||||||
|
cp -r $src/* $out/share/wireplumber/wireplumber.conf.d
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
)];
|
||||||
|
|
||||||
|
services.printing.startWhenNeeded = false;
|
||||||
|
|
||||||
|
system.stateVersion = "23.05";
|
||||||
|
};
|
||||||
|
}
|
10
hosts/main/wireplumber/51-digital-output.conf
Normal file
10
hosts/main/wireplumber/51-digital-output.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
monitor.alsa.rules = [{
|
||||||
|
matches = [{
|
||||||
|
node.name = "alsa_output.pci-0000_00_1f.3.iec958-stereo"
|
||||||
|
}]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
node.description = "Digital Output"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
10
hosts/main/wireplumber/51-hdmi-otuput.conf
Normal file
10
hosts/main/wireplumber/51-hdmi-otuput.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
monitor.alsa.rules = [{
|
||||||
|
matches = [{
|
||||||
|
node.name = "alsa_output.pci-0000_01_00.1.hdmi-stereo"
|
||||||
|
}]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
node.description = "Monitor speakers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
11
hosts/main/wireplumber/51-razerHeadphones-device.conf
Normal file
11
hosts/main/wireplumber/51-razerHeadphones-device.conf
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
monitor.alsa.rules = [{
|
||||||
|
matches = [{
|
||||||
|
device.name = "alsa_card.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00"
|
||||||
|
}]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
device.description = "Headphones"
|
||||||
|
device.profile = "Pro Audio"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
10
hosts/main/wireplumber/51-razerHeadphones-input.conf
Normal file
10
hosts/main/wireplumber/51-razerHeadphones-input.conf
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
monitor.alsa.rules = [{
|
||||||
|
matches = [{
|
||||||
|
node.name = "alsa_input.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-input-0"
|
||||||
|
}]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
node.description = "Headphones"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
22
hosts/main/wireplumber/51-razerHeadphones-output.conf
Normal file
22
hosts/main/wireplumber/51-razerHeadphones-output.conf
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
monitor.alsa.rules = [
|
||||||
|
{
|
||||||
|
matches = [{
|
||||||
|
node.name = "alsa_output.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-output-0"
|
||||||
|
}]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
node.description = "Headphones (Chat)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [{
|
||||||
|
node.name = "alsa_output.usb-Razer_Razer_USB_Audio_Controller_000000000000000000000000-00.pro-output-1"
|
||||||
|
}]
|
||||||
|
actions = {
|
||||||
|
update-props = {
|
||||||
|
node.description = "Headphones (Game)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
|
@ -8,6 +8,7 @@
|
||||||
../nix-os/adb.nix
|
../nix-os/adb.nix
|
||||||
../nix-os/locale.nix
|
../nix-os/locale.nix
|
||||||
../nix-os/shell.nix
|
../nix-os/shell.nix
|
||||||
|
../nix-os/gnupg.nix
|
||||||
|
|
||||||
../nix-os/desktopManagers/gnome.nix
|
../nix-os/desktopManagers/gnome.nix
|
||||||
../nix-os/displayManagers/gdm.nix
|
../nix-os/displayManagers/gdm.nix
|
||||||
|
|
4
lock.nix
4
lock.nix
|
@ -4,7 +4,7 @@
|
||||||
sha256 = "1rq8mrlmbzpcbv9ys0x88alw30ks70jlmvnfr2j8v830yy5wvw7h";
|
sha256 = "1rq8mrlmbzpcbv9ys0x88alw30ks70jlmvnfr2j8v830yy5wvw7h";
|
||||||
};
|
};
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
revision = "10c832d0548e9e3a6df7eb51e68c2783212a303e";
|
revision = "05405724efa137a0b899cce5ab4dde463b4fd30b";
|
||||||
sha256 = "1p206hgfxbz0rmkzaslfrknbdss4n4dnb09pi5466h8ksmm8216q";
|
sha256 = "06490pn22x9xl4chfx12iwdgx7nlbn14v8x05rnv2y1nancljisl";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
proprietaryCodecs = true;
|
proprietaryCodecs = true;
|
||||||
commandLineArgs = [ "--ozone-platform=wayland" ];
|
commandLineArgs = [ "--ozone-platform=wayland" ];
|
||||||
})
|
})
|
||||||
discord-canary
|
vesktop
|
||||||
unstablePkgs.vscode
|
unstablePkgs.vscode
|
||||||
gimp
|
gimp
|
||||||
inkscape
|
inkscape
|
||||||
|
|
|
@ -5,23 +5,7 @@
|
||||||
{ inputs, lib, pkgs, ... }:
|
{ inputs, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
/*
|
inherit (pkgs) mkWrappedExecutable;
|
||||||
* pkg: package - nixpkgs package
|
|
||||||
* exe: string - executable (under bin) in pkgs
|
|
||||||
* wrapperArgs: string[] - arguments to pass to the wrapper
|
|
||||||
*/
|
|
||||||
mkWrappedExecutable = {pkg, exe ? pkg.meta.mainProgram, wrapperArgs}: let inherit (pkgs) lib makeWrapper; in lib.hiPrio (
|
|
||||||
pkgs.stdenv.mkDerivation {
|
|
||||||
inherit wrapperArgs;
|
|
||||||
name = "${pkg.name}-wrap-${exe}";
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
phases = ["installPhase"];
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} $wrapperArgs
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# bool -> nixpkgs[]
|
# bool -> nixpkgs[]
|
||||||
wrappedNixExecutables = inEnvironment: assert builtins.isBool inEnvironment; [
|
wrappedNixExecutables = inEnvironment: assert builtins.isBool inEnvironment; [
|
||||||
|
@ -79,6 +63,21 @@ in
|
||||||
rerere.enabled = true;
|
rerere.enabled = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Use nix-index for command-not-found handler
|
||||||
|
programs.command-not-found.enable = false;
|
||||||
|
programs.nix-index = {
|
||||||
|
package = pkgs.nix-index.override {
|
||||||
|
nix-index-unwrapped = pkgs.nix-index-unwrapped.overrideAttrs (oldAttrs: {
|
||||||
|
patches = oldAttrs.patches or [] ++ [
|
||||||
|
../pkgs/by-name/ni/nix-index/cnfOutput.patch
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
enable = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Enable fail2ban because of the OpenSSH server
|
# Enable fail2ban because of the OpenSSH server
|
||||||
services.fail2ban = {
|
services.fail2ban = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
15
nix-os/gnupg.nix
Normal file
15
nix-os/gnupg.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
config = {
|
||||||
|
# Use pcscd for smartcard support
|
||||||
|
services.pcscd.enable = true;
|
||||||
|
|
||||||
|
environment.systemPackages = [(
|
||||||
|
pkgs.gnupg.overrideAttrs (superAttrs: {
|
||||||
|
configureFlags = superAttrs.configureFlags or []
|
||||||
|
++ [ "--disable-ccid-driver" ];
|
||||||
|
})
|
||||||
|
)];
|
||||||
|
};
|
||||||
|
}
|
|
@ -13,10 +13,12 @@
|
||||||
open = false;
|
open = false;
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
|
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
|
||||||
version = "555.42.02";
|
version = "555.58.02";
|
||||||
sha256_64bit = "sha256-k7cI3ZDlKp4mT46jMkLaIrc2YUx1lh1wj/J4SVSHWyk=";
|
sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
|
||||||
settingsSha256 = "sha256-rtDxQjClJ+gyrCLvdZlT56YyHQ4sbaL+d5tL4L4VfkA=";
|
sha256_aarch64 = "sha256-wb20isMrRg8PeQBU96lWJzBMkjfySAUaqt4EgZnhyF8=";
|
||||||
persistencedSha256 = "";
|
openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY=";
|
||||||
|
settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
|
||||||
|
persistencedSha256 = "sha256-a1D7ZZmcKFWfPjjH1REqPM5j/YLWKnbkP9qfRyIyxAw=";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nixpkgs.config.nvidia.acceptLicense = true;
|
nixpkgs.config.nvidia.acceptLicense = true;
|
||||||
|
|
27
outputs.nix
27
outputs.nix
|
@ -1,11 +1,15 @@
|
||||||
{ inputs ? import ./inputs.nix {} }:
|
{
|
||||||
|
inputs ? import ./inputs.nix {},
|
||||||
|
selfPath ? ./.
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
lib = (import "${inputs.nixpkgs}/lib").extend (import ./lib/overlays/version-info-fixup.nix { inherit inputs; });
|
lib = (import "${inputs.nixpkgs}/lib").extend (import ./lib/overlays/version-info-fixup.nix { inherit inputs; });
|
||||||
|
|
||||||
self = {
|
self = {
|
||||||
inherit lib inputs;
|
inherit inputs lib self;
|
||||||
|
__toString = _: selfPath;
|
||||||
modifiedNixpkgs = import ./pkgs/top-level/impure.nix;
|
modifiedNixpkgs = import ./pkgs/top-level/impure.nix;
|
||||||
modifiedNixpkgsPure = import ./pkgs/top-level/default.nix;
|
modifiedNixpkgsPure = import ./pkgs/top-level/default.nix;
|
||||||
overlays = {
|
overlays = {
|
||||||
|
@ -18,30 +22,30 @@ self = {
|
||||||
filePaths = lib.pipe ./hosts [
|
filePaths = lib.pipe ./hosts [
|
||||||
builtins.readDir
|
builtins.readDir
|
||||||
( lib.filterAttrs (name: type:
|
( lib.filterAttrs (name: type:
|
||||||
# filter out non-nix files
|
( # regular .nix files
|
||||||
type == "regular"
|
(type == "regular" && lib.hasSuffix ".nix" name)
|
||||||
# filter out files that don't end in .nix
|
|| # directories that contain a default.nix file
|
||||||
&& lib.hasSuffix ".nix" name
|
(type == "directory" && builtins.pathExists "${./hosts}/${name}/default.nix")
|
||||||
|
)
|
||||||
# filter out files that start with .
|
# filter out files that start with .
|
||||||
&& !lib.hasPrefix "." name
|
&& !lib.hasPrefix "." name
|
||||||
))
|
))
|
||||||
(lib.mapAttrsToList (name: _: name))
|
|
||||||
];
|
];
|
||||||
nixosSystem = import "${inputs.nixpkgs}/nixos/lib/eval-config.nix";
|
nixosSystem = import "${inputs.nixpkgs}/nixos/lib/eval-config.nix";
|
||||||
in
|
in
|
||||||
# mapped list of nix file paths to attrSet with initialized NixOS configurations,
|
# mapped list of nix file paths to attrSet with initialized NixOS configurations,
|
||||||
# whose names are derived from file names
|
# whose names are derived from file names
|
||||||
lib.pipe filePaths [
|
lib.pipe filePaths [
|
||||||
(builtins.map (name: {
|
(builtins.mapAttrs (name: type: {
|
||||||
name = builtins.substring 0 (builtins.stringLength name - 4) name;
|
name = if type == "directory" then name else builtins.substring 0 (builtins.stringLength name - 4) name;
|
||||||
value = nixosSystem {
|
value = nixosSystem {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/${name}
|
./hosts/${name}
|
||||||
{
|
{
|
||||||
config.nixpkgs.overlays = [
|
config.nixpkgs.overlays = [
|
||||||
( import ./pkgs/overlays/selfExpr.nix { nixpkgsPath = "${builtins.toString ./.}/pkgs/top-level/impure.nix"; } )
|
( import ./pkgs/overlays/selfExpr.nix { nixpkgsPath = "${self}/pkgs/top-level/impure.nix"; } )
|
||||||
( import "${inputs.nixpkgs}/pkgs/top-level/by-name-overlay.nix" "${builtins.toString ./.}/pkgs/by-name" )
|
( import ./pkgs/top-level/by-name-overlay.nix "${self}/pkgs/by-name" )
|
||||||
self.overlays.versionInfoFixup
|
self.overlays.versionInfoFixup
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -49,6 +53,7 @@ self = {
|
||||||
specialArgs = { inherit self inputs; };
|
specialArgs = { inherit self inputs; };
|
||||||
};
|
};
|
||||||
}))
|
}))
|
||||||
|
builtins.attrValues
|
||||||
builtins.listToAttrs
|
builtins.listToAttrs
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
29
pkgs/by-name/mk/mkScriptOverride/package.nix
Normal file
29
pkgs/by-name/mk/mkScriptOverride/package.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
src,
|
||||||
|
script,
|
||||||
|
...
|
||||||
|
} @ args:
|
||||||
|
lib.hiPrio (stdenv.mkDerivation (
|
||||||
|
{
|
||||||
|
src = src;
|
||||||
|
name = "${src.name}-script-override";
|
||||||
|
phases = [ "installPhase" "scriptOverridePhase" ];
|
||||||
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
|
|
||||||
|
cp -r $src $out
|
||||||
|
chmod u+w -R $out
|
||||||
|
|
||||||
|
runHook postInstall
|
||||||
|
'';
|
||||||
|
scriptOverridePhase = script;
|
||||||
|
} // lib.removeAttrs args [
|
||||||
|
"pkg"
|
||||||
|
"commands"
|
||||||
|
]
|
||||||
|
))
|
22
pkgs/by-name/mk/mkWrappedExecutable/package.nix
Normal file
22
pkgs/by-name/mk/mkWrappedExecutable/package.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
makeWrapper,
|
||||||
|
stdenv
|
||||||
|
}:
|
||||||
|
|
||||||
|
/*
|
||||||
|
pkg: package - nixpkgs package
|
||||||
|
exe: string - executable (under bin) in pkg
|
||||||
|
wrapperArgs: string[] - arguments to pass to the wrapper
|
||||||
|
*/
|
||||||
|
{ pkg, exe ? pkg.meta.mainProgram, wrapperArgs }:
|
||||||
|
lib.hiPrio (stdenv.mkDerivation {
|
||||||
|
inherit wrapperArgs;
|
||||||
|
name = "${pkg.name}-wrap-${exe}";
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
phases = ["installPhase"];
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/bin
|
||||||
|
makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} $wrapperArgs
|
||||||
|
'';
|
||||||
|
})
|
66
pkgs/by-name/ni/nix-index/cnfOutput.patch
Normal file
66
pkgs/by-name/ni/nix-index/cnfOutput.patch
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
diff --git a/command-not-found.sh b/command-not-found.sh
|
||||||
|
index 5f30bad..3854297 100755
|
||||||
|
--- a/command-not-found.sh
|
||||||
|
+++ b/command-not-found.sh
|
||||||
|
@@ -73,51 +73,30 @@ EOF
|
||||||
|
else
|
||||||
|
if [ -e "$HOME/.nix-profile/manifest.json" ]; then
|
||||||
|
>&2 cat <<EOF
|
||||||
|
-The program '$cmd' is currently not installed. You can install it
|
||||||
|
-by typing:
|
||||||
|
- nix profile install $toplevel#$attrs
|
||||||
|
-
|
||||||
|
-Or run it once with:
|
||||||
|
- nix shell $toplevel#$attrs -c $cmd ...
|
||||||
|
+The program '$cmd' is not in your PATH. You can make it available in an
|
||||||
|
+ephemeral shell by typing:
|
||||||
|
+ nix shell $toplevel#$attrs
|
||||||
|
EOF
|
||||||
|
else
|
||||||
|
>&2 cat <<EOF
|
||||||
|
-The program '$cmd' is currently not installed. You can install it
|
||||||
|
-by typing:
|
||||||
|
- nix-env -iA $toplevel.$attrs
|
||||||
|
-
|
||||||
|
-Or run it once with:
|
||||||
|
- nix-shell -p $attrs --run '$cmd ...'
|
||||||
|
+The program '$cmd' is not in your PATH. You can make it available in an
|
||||||
|
+ephemeral shell by typing:
|
||||||
|
+ nix-shell -p $attrs
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
>&2 cat <<EOF
|
||||||
|
-The program '$cmd' is currently not installed. It is provided by
|
||||||
|
-several packages. You can install it by typing one of the following:
|
||||||
|
-EOF
|
||||||
|
-
|
||||||
|
- # ensure we get each element of attrs
|
||||||
|
- # in a cross platform way
|
||||||
|
- while read attr; do
|
||||||
|
- if [ -e "$HOME/.nix-profile/manifest.json" ]; then
|
||||||
|
- >&2 echo " nix profile install $toplevel#$attr"
|
||||||
|
- else
|
||||||
|
- >&2 echo " nix-env -iA $toplevel.$attr"
|
||||||
|
- fi
|
||||||
|
- done <<< "$attrs"
|
||||||
|
-
|
||||||
|
- >&2 cat <<EOF
|
||||||
|
-
|
||||||
|
-Or run it once with:
|
||||||
|
+The program '$cmd' is not in your PATH. You can make it available in an
|
||||||
|
+ephemeral shell by typing:
|
||||||
|
EOF
|
||||||
|
|
||||||
|
while read attr; do
|
||||||
|
if [ -e "$HOME/.nix-profile/manifest.json" ]; then
|
||||||
|
- >&2 echo " nix shell $toplevel#$attr -c $cmd ..."
|
||||||
|
+ >&2 echo " nix shell $toplevel#$attr"
|
||||||
|
else
|
||||||
|
- >&2 echo " nix-shell -p $attr --run '$cmd ...'"
|
||||||
|
+ >&2 echo " nix-shell -p $attr"
|
||||||
|
fi
|
||||||
|
done <<< "$attrs"
|
||||||
|
;;
|
|
@ -25,11 +25,13 @@ self: super: {
|
||||||
in ''
|
in ''
|
||||||
{ ... } @ args:
|
{ ... } @ args:
|
||||||
|
|
||||||
import ${nixpkgsPath} {
|
import ${nixpkgsPath} (
|
||||||
${self.lib.optionalString useConfig configText}
|
{
|
||||||
} // builtins.removeAttrs args (builtins.fromJSON '''
|
${self.lib.optionalString useConfig configText}
|
||||||
${removedAttrNamesText}
|
} // builtins.removeAttrs args (builtins.fromJSON '''
|
||||||
''')
|
${removedAttrNamesText}
|
||||||
|
''')
|
||||||
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mkNixpkgsChannel = args: self.writeTextFile {
|
mkNixpkgsChannel = args: self.writeTextFile {
|
||||||
|
|
50
pkgs/top-level/by-name-overlay.nix
Normal file
50
pkgs/top-level/by-name-overlay.nix
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
# Modified copy of github:NixOS/nixpkgs pkgs/top-level/by-name-overlay.nix
|
||||||
|
# as of commit c0d0be00d4ecc4b51d2d6948e37466194c1e6c51
|
||||||
|
|
||||||
|
# This file turns the pkgs/by-name directory into an overlay that adds all the defined packages.
|
||||||
|
# No validity checks are done here.
|
||||||
|
|
||||||
|
# Type: Path -> Overlay
|
||||||
|
baseDirectory:
|
||||||
|
let
|
||||||
|
lib = (import ../../outputs.nix {}).lib;
|
||||||
|
|
||||||
|
inherit (builtins)
|
||||||
|
readDir
|
||||||
|
;
|
||||||
|
|
||||||
|
inherit (lib.attrsets)
|
||||||
|
mapAttrs
|
||||||
|
mapAttrsToList
|
||||||
|
mergeAttrsList
|
||||||
|
;
|
||||||
|
|
||||||
|
# Package files for a single shard
|
||||||
|
# Type: String -> String -> String -> AttrsOf Path
|
||||||
|
namesForShard = nixFilename: shard: type:
|
||||||
|
if type != "directory" then
|
||||||
|
# Ignore all non-directories.
|
||||||
|
{ }
|
||||||
|
else
|
||||||
|
mapAttrs
|
||||||
|
(name: _: baseDirectory + "/${shard}/${name}/${nixFilename}")
|
||||||
|
(readDir (baseDirectory + "/${shard}"));
|
||||||
|
|
||||||
|
# The attribute set mapping names to the package files defining them
|
||||||
|
# Type: String -> AttrsOf Path
|
||||||
|
packageFiles = nixFilename: lib.pipe baseDirectory [
|
||||||
|
readDir
|
||||||
|
(mapAttrsToList (namesForShard nixFilename))
|
||||||
|
mergeAttrsList
|
||||||
|
# Filter out paths that don't have a ${nixFilename} file
|
||||||
|
(lib.filterAttrs (_: lib.pathExists))
|
||||||
|
];
|
||||||
|
in
|
||||||
|
self: super:
|
||||||
|
mapAttrs (name: file:
|
||||||
|
self.callPackage file { inherit self super; package = super.${name}; }
|
||||||
|
) (packageFiles "override.nix")
|
||||||
|
// mapAttrs (name: file:
|
||||||
|
self.callPackage file { }
|
||||||
|
) (packageFiles "package.nix")
|
||||||
|
|
|
@ -12,10 +12,11 @@ let
|
||||||
|
|
||||||
options = (builtins.removeAttrs args attrsToRemove) // {
|
options = (builtins.removeAttrs args attrsToRemove) // {
|
||||||
overlays = (args.overlays or []) ++ [
|
overlays = (args.overlays or []) ++ [
|
||||||
( import ../overlays/selfExpr.nix { nixpkgsPath = ./impure.nix; } )
|
# ../.. should be nix store path that represents self in outputs.nix that is gc-rooted by this point
|
||||||
|
( import ../overlays/selfExpr.nix { nixpkgsPath = "${builtins.toString ../..}/pkgs/top-level/impure.nix"; } )
|
||||||
( import ../overlays/unstable.nix )
|
( import ../overlays/unstable.nix )
|
||||||
( import ../overlays/version-info-fixup.nix { inherit inputs; } )
|
( import ../overlays/version-info-fixup.nix { inherit inputs; } )
|
||||||
( import "${inputs.nixpkgs}/pkgs/top-level/by-name-overlay.nix" ../by-name )
|
( import ./by-name-overlay.nix ../by-name )
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
Loading…
Add table
Reference in a new issue