Compare commits
5 commits
898b301fbc
...
be2a3c31e5
Author | SHA1 | Date | |
---|---|---|---|
be2a3c31e5 | |||
b5f46c14ee | |||
ed66ca84bc | |||
82bf8ab05f | |||
9abc9c10ba |
4 changed files with 36 additions and 16 deletions
|
@ -21,7 +21,6 @@
|
|||
networking.hostName = "wroclaw-hp";
|
||||
networking.networkmanager.enable = true;
|
||||
networking.firewall.enable = true;
|
||||
services.xserver.displayManager.gdm.wayland = lib.mkForce true;
|
||||
hardware.sensor.iio.enable = true;
|
||||
|
||||
networking.firewall.allowedTCPPortRanges = [
|
||||
|
|
|
@ -6,23 +6,37 @@
|
|||
|
||||
let
|
||||
/*
|
||||
* pkgs: package - nixpkgs package
|
||||
* 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 pkgs.stdenv.mkDerivation {
|
||||
name = "${pkg.name}-wrap-${exe}";
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
phases = ["installPhase"];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper ${pkg}/bin/${exe} $out/bin/${exe} ${lib.concatStringsSep " " wrapperArgs}
|
||||
'';
|
||||
};
|
||||
wrapedNixPrograms = builtins.map lib.hiPrio [
|
||||
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar-with-logs"];})
|
||||
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[]
|
||||
wrappedNixExecutables = inEnvironment: assert builtins.isBool inEnvironment; [
|
||||
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-build"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar${lib.optionalString inEnvironment "-with-logs"}"];})
|
||||
(mkWrappedExecutable {pkg = pkgs.nix; exe = "nix-shell"; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];})
|
||||
];
|
||||
wrappedNixosExecutables = [
|
||||
(mkWrappedExecutable {pkg = pkgs.nixos-rebuild; wrapperArgs = ["--add-flags" "\"--log-format\"" "--add-flags" "bar"];})
|
||||
];
|
||||
wrappedNix = (pkgs.buildEnv {
|
||||
name = "wrappedNix-${pkgs.nix.version}";
|
||||
paths = [ pkgs.nix ] ++ wrappedNixExecutables false;
|
||||
}).overrideAttrs {
|
||||
version = pkgs.nix.version;
|
||||
};
|
||||
in
|
||||
{
|
||||
# kernel
|
||||
|
@ -33,6 +47,7 @@ in
|
|||
|
||||
# Allow unfree packages
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.package = wrappedNix;
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
|
@ -45,7 +60,8 @@ in
|
|||
fastfetch
|
||||
smartmontools
|
||||
ddrescue
|
||||
] ++ wrapedNixPrograms;
|
||||
] ++ wrappedNixExecutables true
|
||||
++ wrappedNixosExecutables;
|
||||
|
||||
programs.git.enable = true;
|
||||
programs.git.config = {
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
config = {
|
||||
services.xserver.displayManager.gdm = {
|
||||
enable = true;
|
||||
wayland = false;
|
||||
autoSuspend = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
powerManagement.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
|
||||
version = "555.42.02";
|
||||
sha256_64bit = "sha256-k7cI3ZDlKp4mT46jMkLaIrc2YUx1lh1wj/J4SVSHWyk=";
|
||||
settingsSha256 = "sha256-rtDxQjClJ+gyrCLvdZlT56YyHQ4sbaL+d5tL4L4VfkA=";
|
||||
persistencedSha256 = "";
|
||||
};
|
||||
};
|
||||
nixpkgs.config.nvidia.acceptLicense = true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue