forked from pub-solar/os
Merge branch 'template' into template
This commit is contained in:
commit
58b0f1ae65
10
default.nix
Normal file
10
default.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
(import
|
||||||
|
(
|
||||||
|
fetchTarball {
|
||||||
|
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
|
||||||
|
sha256 = "sha256:0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
{
|
||||||
|
src = ./.;
|
||||||
|
}).defaultNix.packages.x86_64-linux
|
12
flake.lock
12
flake.lock
|
@ -52,11 +52,11 @@
|
||||||
},
|
},
|
||||||
"master": {
|
"master": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1607981906,
|
"lastModified": 1610960440,
|
||||||
"narHash": "sha256-tFuNBkK0F5km1Lq5ulLgLVm3BvOvI7t4k4Y7xTIo3QE=",
|
"narHash": "sha256-0ZDzGoFhROKZwcW2Sa2CXiwYL6br09JORgEHr58w/Ew=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "dd95aa337e23a8a48fe82f0f7b1cced8bc03e379",
|
"rev": "3bdf95ceb5660273a01ed2e5be2676487f7e820e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -67,11 +67,11 @@
|
||||||
},
|
},
|
||||||
"nixos": {
|
"nixos": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1607967859,
|
"lastModified": 1610885893,
|
||||||
"narHash": "sha256-biRVmLlWfxIvB2O+mkFbObb4MmCzbYvpy5Rap4g9Mig=",
|
"narHash": "sha256-VAETd1jhnWUJmq0b8Dbi9mo4qvS+AYC3d9tmVfnf2zQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "7362dab2c9bd21eeef831f32608161584b388ef4",
|
"rev": "3888fe83e1c7b5331d032177b039e91f83bf34e1",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
32
flake.nix
32
flake.nix
|
@ -27,26 +27,29 @@
|
||||||
externOverlays = [ nur.overlay devshell.overlay ];
|
externOverlays = [ nur.overlay devshell.overlay ];
|
||||||
externModules = [ home.nixosModules.home-manager ];
|
externModules = [ home.nixosModules.home-manager ];
|
||||||
|
|
||||||
|
pkgs' = unstable:
|
||||||
|
let
|
||||||
|
override = import ./pkgs/override.nix;
|
||||||
|
overlays = (attrValues self.overlays)
|
||||||
|
++ externOverlays
|
||||||
|
++ [ self.overlay (override unstable) ];
|
||||||
|
in
|
||||||
|
pkgImport nixos overlays;
|
||||||
|
|
||||||
|
unstable' = pkgImport master [ ];
|
||||||
|
|
||||||
osSystem = "x86_64-linux";
|
osSystem = "x86_64-linux";
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
let
|
let
|
||||||
system = osSystem;
|
system = osSystem;
|
||||||
pkgset =
|
unstablePkgs = unstable' system;
|
||||||
let
|
osPkgs = pkgs' unstablePkgs system;
|
||||||
overlays =
|
|
||||||
(attrValues self.overlays)
|
|
||||||
++ externOverlays
|
|
||||||
++ [ self.overlay ];
|
|
||||||
in
|
|
||||||
genPkgset {
|
|
||||||
inherit master nixos overlays system;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations =
|
nixosConfigurations =
|
||||||
import ./hosts (recursiveUpdate inputs {
|
import ./hosts (recursiveUpdate inputs {
|
||||||
inherit lib pkgset utils externModules system;
|
inherit lib osPkgs unstablePkgs utils externModules system;
|
||||||
});
|
});
|
||||||
|
|
||||||
overlay = import ./pkgs;
|
overlay = import ./pkgs;
|
||||||
|
@ -66,11 +69,8 @@
|
||||||
(eachDefaultSystem
|
(eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = pkgImport {
|
unstablePkgs = unstable' system;
|
||||||
inherit system;
|
pkgs = pkgs' unstablePkgs system;
|
||||||
pkgs = nixos;
|
|
||||||
overlays = [ devshell.overlay ];
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = flattenTreeSystem system
|
packages = flattenTreeSystem system
|
||||||
(genPackages {
|
(genPackages {
|
||||||
|
|
|
@ -3,9 +3,10 @@
|
||||||
, nixos
|
, nixos
|
||||||
, master
|
, master
|
||||||
, nixos-hardware
|
, nixos-hardware
|
||||||
, pkgset
|
, osPkgs
|
||||||
, self
|
, self
|
||||||
, system
|
, system
|
||||||
|
, unstablePkgs
|
||||||
, utils
|
, utils
|
||||||
, externModules
|
, externModules
|
||||||
, ...
|
, ...
|
||||||
|
@ -13,7 +14,6 @@
|
||||||
let
|
let
|
||||||
inherit (utils) recImport;
|
inherit (utils) recImport;
|
||||||
inherit (builtins) attrValues removeAttrs;
|
inherit (builtins) attrValues removeAttrs;
|
||||||
inherit (pkgset) osPkgs unstablePkgs;
|
|
||||||
|
|
||||||
unstableModules = [ ];
|
unstableModules = [ ];
|
||||||
addToDisabledModules = [ ];
|
addToDisabledModules = [ ];
|
||||||
|
@ -67,14 +67,6 @@ let
|
||||||
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
||||||
};
|
};
|
||||||
|
|
||||||
overrides = {
|
|
||||||
nixpkgs.overlays =
|
|
||||||
let
|
|
||||||
override = import ../pkgs/override.nix unstablePkgs;
|
|
||||||
in
|
|
||||||
[ override ];
|
|
||||||
};
|
|
||||||
|
|
||||||
local = import "${toString ./.}/${hostName}.nix";
|
local = import "${toString ./.}/${hostName}.nix";
|
||||||
|
|
||||||
# Everything in `./modules/list.nix`.
|
# Everything in `./modules/list.nix`.
|
||||||
|
@ -86,7 +78,6 @@ let
|
||||||
core
|
core
|
||||||
global
|
global
|
||||||
local
|
local
|
||||||
overrides
|
|
||||||
modOverrides
|
modOverrides
|
||||||
] ++ externModules;
|
] ++ externModules;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (builtins) attrNames isAttrs readDir listToAttrs;
|
inherit (builtins) attrNames attrValues isAttrs readDir listToAttrs mapAttrs;
|
||||||
|
|
||||||
inherit (lib) filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix
|
inherit (lib) fold filterAttrs hasSuffix mapAttrs' nameValuePair removeSuffix
|
||||||
recursiveUpdate genAttrs;
|
recursiveUpdate genAttrs;
|
||||||
|
|
||||||
# mapFilterAttrs ::
|
# mapFilterAttrs ::
|
||||||
|
@ -14,8 +14,8 @@ let
|
||||||
# Generate an attribute set by mapping a function over a list of values.
|
# Generate an attribute set by mapping a function over a list of values.
|
||||||
genAttrs' = values: f: listToAttrs (map f values);
|
genAttrs' = values: f: listToAttrs (map f values);
|
||||||
|
|
||||||
pkgImport = { pkgs, system, overlays }:
|
pkgImport = nixpkgs: overlays: system:
|
||||||
import pkgs {
|
import nixpkgs {
|
||||||
inherit system overlays;
|
inherit system overlays;
|
||||||
config = { allowUnfree = true; };
|
config = { allowUnfree = true; };
|
||||||
};
|
};
|
||||||
|
@ -33,20 +33,6 @@ in
|
||||||
{
|
{
|
||||||
inherit mapFilterAttrs genAttrs' pkgImport pathsToImportedAttrs;
|
inherit mapFilterAttrs genAttrs' pkgImport pathsToImportedAttrs;
|
||||||
|
|
||||||
genPkgset = { master, nixos, overlays, system }:
|
|
||||||
{
|
|
||||||
osPkgs = pkgImport {
|
|
||||||
inherit system overlays;
|
|
||||||
pkgs = nixos;
|
|
||||||
};
|
|
||||||
|
|
||||||
unstablePkgs = pkgImport {
|
|
||||||
inherit system;
|
|
||||||
overlays = [];
|
|
||||||
pkgs = master;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
overlayPaths =
|
overlayPaths =
|
||||||
let
|
let
|
||||||
overlayDir = ../overlays;
|
overlayDir = ../overlays;
|
||||||
|
@ -86,12 +72,19 @@ in
|
||||||
genPackages = { self, pkgs }:
|
genPackages = { self, pkgs }:
|
||||||
let
|
let
|
||||||
inherit (self) overlay overlays;
|
inherit (self) overlay overlays;
|
||||||
packages = overlay pkgs pkgs;
|
packagesNames = attrNames (overlay null null)
|
||||||
overlayPkgs =
|
++ attrNames (fold
|
||||||
genAttrs
|
(attr: sum: recursiveUpdate sum attr)
|
||||||
(attrNames overlays)
|
{ }
|
||||||
(name: (overlays."${name}" pkgs pkgs)."${name}");
|
(attrValues
|
||||||
|
(mapAttrs (_: v: v null null) overlays)
|
||||||
|
)
|
||||||
|
);
|
||||||
in
|
in
|
||||||
recursiveUpdate packages overlayPkgs;
|
fold
|
||||||
|
(key: sum: recursiveUpdate sum {
|
||||||
|
${key} = pkgs.${key};
|
||||||
|
})
|
||||||
|
{ }
|
||||||
|
packagesNames;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,5 +8,4 @@ final: prev: {
|
||||||
libinih = prev.callPackage ./development/libraries/libinih { };
|
libinih = prev.callPackage ./development/libraries/libinih { };
|
||||||
steamcompmgr =
|
steamcompmgr =
|
||||||
prev.callPackage ./applications/window-managers/steamcompmgr { };
|
prev.callPackage ./applications/window-managers/steamcompmgr { };
|
||||||
miningcore = prev.callPackage ./applications/blockchains/miningcore { };
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue