overlays: Create overlays

This commit is contained in:
PapaTutuWawa 2021-08-24 11:36:15 +02:00
parent e3c5c694a6
commit 669c20a354
12 changed files with 46 additions and 71 deletions

View File

@ -1,9 +1,6 @@
{ config, pkgs, modulesPath, lib, ... }: { config, pkgs, modulesPath, lib, ... }:
let {
customPkgs = import ../packages/overlay.nix;
unstable = (import ../modules/unstable.nix config);
in {
imports = [ imports = [
./generic.nix ./generic.nix
../modules/hardware/generic.nix ../modules/hardware/bluetooth.nix ../modules/hardware/wifi.nix ../modules/hardware/video.nix ../modules/hardware/mobile.nix ../modules/hardware/generic.nix ../modules/hardware/bluetooth.nix ../modules/hardware/wifi.nix ../modules/hardware/video.nix ../modules/hardware/mobile.nix
@ -15,14 +12,12 @@ in {
]; ];
nixpkgs.overlays = [ nixpkgs.overlays = [
customPkgs # Unstable, NUR, ...
(import ../overlays/unstable.nix pkgs)
(import ../overlays/nur.nix pkgs)
(import ../overlays/custom.nix pkgs)
]; ];
nixpkgs.config.packageOverrides = pkgs: {
nur = (import ../modules/nur.nix pkgs);
unstable = unstable;
};
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
unstable.firmwareLinuxNonfree unstable.firmwareLinuxNonfree

View File

@ -1,9 +1,6 @@
{ config, pkgs, modulesPath, lib, ... }: { config, pkgs, modulesPath, lib, ... }:
let {
unstable = (import ../modules/unstable.nix config);
customPkgs = import ../packages/overlay.nix;
in {
imports = [ imports = [
./generic.nix ./generic.nix
../modules/hardware/generic.nix ../modules/hardware/video.nix ../modules/hardware/generic.nix ../modules/hardware/video.nix
@ -17,13 +14,12 @@ in {
ref = "master"; ref = "master";
rev = "ce0e9482d53d69bedc8416d8a984d00e17607826"; rev = "ce0e9482d53d69bedc8416d8a984d00e17607826";
})) }))
customPkgs
];
nixpkgs.config.packageOverrides = pkgs: { # Unstable, NUR, ...
nur = (import ../modules/nur.nix pkgs); (import ../overlays/unstable.nix pkgs)
unstable = unstable; (import ../overlays/nur.nix pkgs)
}; (import ../overlays/custom.nix pkgs)
];
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [

View File

@ -1,8 +1,6 @@
{ config, pkgs, modulesPath, lib, fetchGit, ... }: { config, pkgs, modulesPath, lib, fetchGit, ... }:
let {
customPkgs = import ../packages/overlay.nix;
in {
imports = [ imports = [
./generic.nix ./generic.nix
../modules/hardware/generic.nix ../modules/hardware/video.nix ../modules/hardware/desktop.nix ../modules/hardware/generic.nix ../modules/hardware/video.nix ../modules/hardware/desktop.nix
@ -80,12 +78,9 @@ in {
}) })
# Unstable, NUR, ... # Unstable, NUR, ...
(final: prev: { (import ../overlays/unstable.nix pkgs)
unstable = (import ../modules/unstable.nix config); (import ../overlays/nur.nix pkgs)
nur = (import ../modules/nur.nix pkgs); (import ../overlays/custom.nix pkgs)
})
customPkgs
]; ];
security = { security = {

View File

@ -1,7 +1,5 @@
{ config, ... }: { pkgs, ... }:
let {
unstable = (import ../unstable.nix config); environment.systemPackages = with pkgs; [ unstable.mesa ];
in {
environment.systemPackages = [ unstable.mesa ];
} }

View File

@ -1,8 +0,0 @@
pkgs:
import (builtins.fetchTarball {
url = "https://github.com/nix-community/NUR/archive/master.tar.gz";
sha256 = "0r2pcc6sjxmhg1xxk23648wrwccv2c5v44cfwglx35az5y0hmr1f";
}) {
inherit pkgs;
}

View File

@ -1,8 +1,6 @@
{ pkgs, config, lib, ... }: { pkgs, config, lib, ... }:
let {
unstable = (import ../../unstable.nix config);
in {
config = { config = {
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
@ -10,7 +8,7 @@ in {
gnomeExtensions.appindicator gnomeExtensions.appindicator
gnomeExtensions.caffeine gnomeExtensions.caffeine
gnomeExtensions.gnome-40-ui-improvements gnomeExtensions.gnome-40-ui-improvements
gnomeExtensionsCustom.notification-timeout # Custom package gnomeExtensions.notification-timeout # Custom package
gnomeExtensions.application-volume-mixer gnomeExtensions.application-volume-mixer
gnome.eog gnome.eog
gnome.nautilus gnome.nautilus

View File

@ -1,10 +0,0 @@
config:
let
unstableTarball =
fetchTarball
https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
in
import unstableTarball {
config = config.nixpkgs.config;
}

5
overlays/custom.nix Normal file
View File

@ -0,0 +1,5 @@
pkgs: final: prev:
import ../packages {
pkgs = prev;
}

10
overlays/nur.nix Normal file
View File

@ -0,0 +1,10 @@
pkgs: final: prev:
{
nur = import (builtins.fetchTarball {
url = "https://github.com/nix-community/NUR/archive/master.tar.gz";
sha256 = "0r2pcc6sjxmhg1xxk23648wrwccv2c5v44cfwglx35az5y0hmr1f";
}) {
inherit pkgs;
};
}

10
overlays/unstable.nix Normal file
View File

@ -0,0 +1,10 @@
# NOTE: pkgs is unused but there for consistency with nur.nix
pkgs: final: prev:
let
unstableTarball =
fetchTarball
https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz;
in {
unstable = import unstableTarball {};
}

View File

@ -5,7 +5,7 @@
key-mapper = pkgs.callPackage ./key-mapper { }; key-mapper = pkgs.callPackage ./key-mapper { };
vfio-isolate = pkgs.callPackage ./vfio-isolate { }; vfio-isolate = pkgs.callPackage ./vfio-isolate { };
mopidy-funkwhale = pkgs.callPackage ./mopidy-funkwhale {}; mopidy-funkwhale = pkgs.callPackage ./mopidy-funkwhale {};
gnomeExtensions = { gnomeExtensions = pkgs.gnomeExtensions // {
notification-timeout = pkgs.callPackage ./gnomeExtensions-notification-timeout {}; notification-timeout = pkgs.callPackage ./gnomeExtensions-notification-timeout {};
}; };
replaysorcery = pkgs.callPackage ./replaysorcery {}; replaysorcery = pkgs.callPackage ./replaysorcery {};

View File

@ -1,14 +0,0 @@
self: super:
{
gamemode = super.callPackage ./gamemode {};
key-mapper = super.callPackage ./key-mapper {};
vfio-isolate = super.callPackage ./vfio-isolate {};
mopidy-funkwhale = super.callPackage ./mopidy-funkwhale {};
gnomeExtensionsCustom = {
notification-timeout = super.callPackage ./gnomeExtensions-notification-timeout {};
};
replaysorcery = super.callPackage ./replaysorcery {};
evdev-proxy = super.callPackage ./evdev-proxy {};
anime4k = super.callPackage ./anime4k {};
}