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": {
|
||||
"locked": {
|
||||
"lastModified": 1607981906,
|
||||
"narHash": "sha256-tFuNBkK0F5km1Lq5ulLgLVm3BvOvI7t4k4Y7xTIo3QE=",
|
||||
"lastModified": 1610960440,
|
||||
"narHash": "sha256-0ZDzGoFhROKZwcW2Sa2CXiwYL6br09JORgEHr58w/Ew=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "dd95aa337e23a8a48fe82f0f7b1cced8bc03e379",
|
||||
"rev": "3bdf95ceb5660273a01ed2e5be2676487f7e820e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -67,11 +67,11 @@
|
|||
},
|
||||
"nixos": {
|
||||
"locked": {
|
||||
"lastModified": 1607967859,
|
||||
"narHash": "sha256-biRVmLlWfxIvB2O+mkFbObb4MmCzbYvpy5Rap4g9Mig=",
|
||||
"lastModified": 1610885893,
|
||||
"narHash": "sha256-VAETd1jhnWUJmq0b8Dbi9mo4qvS+AYC3d9tmVfnf2zQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7362dab2c9bd21eeef831f32608161584b388ef4",
|
||||
"rev": "3888fe83e1c7b5331d032177b039e91f83bf34e1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
32
flake.nix
32
flake.nix
|
@ -27,26 +27,29 @@
|
|||
externOverlays = [ nur.overlay devshell.overlay ];
|
||||
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";
|
||||
|
||||
outputs =
|
||||
let
|
||||
system = osSystem;
|
||||
pkgset =
|
||||
let
|
||||
overlays =
|
||||
(attrValues self.overlays)
|
||||
++ externOverlays
|
||||
++ [ self.overlay ];
|
||||
in
|
||||
genPkgset {
|
||||
inherit master nixos overlays system;
|
||||
};
|
||||
unstablePkgs = unstable' system;
|
||||
osPkgs = pkgs' unstablePkgs system;
|
||||
in
|
||||
{
|
||||
nixosConfigurations =
|
||||
import ./hosts (recursiveUpdate inputs {
|
||||
inherit lib pkgset utils externModules system;
|
||||
inherit lib osPkgs unstablePkgs utils externModules system;
|
||||
});
|
||||
|
||||
overlay = import ./pkgs;
|
||||
|
@ -66,11 +69,8 @@
|
|||
(eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = pkgImport {
|
||||
inherit system;
|
||||
pkgs = nixos;
|
||||
overlays = [ devshell.overlay ];
|
||||
};
|
||||
unstablePkgs = unstable' system;
|
||||
pkgs = pkgs' unstablePkgs system;
|
||||
|
||||
packages = flattenTreeSystem system
|
||||
(genPackages {
|
||||
|
|
|
@ -3,9 +3,10 @@
|
|||
, nixos
|
||||
, master
|
||||
, nixos-hardware
|
||||
, pkgset
|
||||
, osPkgs
|
||||
, self
|
||||
, system
|
||||
, unstablePkgs
|
||||
, utils
|
||||
, externModules
|
||||
, ...
|
||||
|
@ -13,7 +14,6 @@
|
|||
let
|
||||
inherit (utils) recImport;
|
||||
inherit (builtins) attrValues removeAttrs;
|
||||
inherit (pkgset) osPkgs unstablePkgs;
|
||||
|
||||
unstableModules = [ ];
|
||||
addToDisabledModules = [ ];
|
||||
|
@ -67,14 +67,6 @@ let
|
|||
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";
|
||||
|
||||
# Everything in `./modules/list.nix`.
|
||||
|
@ -86,7 +78,6 @@ let
|
|||
core
|
||||
global
|
||||
local
|
||||
overrides
|
||||
modOverrides
|
||||
] ++ externModules;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{ lib, ... }:
|
||||
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;
|
||||
|
||||
# mapFilterAttrs ::
|
||||
|
@ -14,8 +14,8 @@ let
|
|||
# Generate an attribute set by mapping a function over a list of values.
|
||||
genAttrs' = values: f: listToAttrs (map f values);
|
||||
|
||||
pkgImport = { pkgs, system, overlays }:
|
||||
import pkgs {
|
||||
pkgImport = nixpkgs: overlays: system:
|
||||
import nixpkgs {
|
||||
inherit system overlays;
|
||||
config = { allowUnfree = true; };
|
||||
};
|
||||
|
@ -33,20 +33,6 @@ in
|
|||
{
|
||||
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 =
|
||||
let
|
||||
overlayDir = ../overlays;
|
||||
|
@ -86,12 +72,19 @@ in
|
|||
genPackages = { self, pkgs }:
|
||||
let
|
||||
inherit (self) overlay overlays;
|
||||
packages = overlay pkgs pkgs;
|
||||
overlayPkgs =
|
||||
genAttrs
|
||||
(attrNames overlays)
|
||||
(name: (overlays."${name}" pkgs pkgs)."${name}");
|
||||
packagesNames = attrNames (overlay null null)
|
||||
++ attrNames (fold
|
||||
(attr: sum: recursiveUpdate sum attr)
|
||||
{ }
|
||||
(attrValues
|
||||
(mapAttrs (_: v: v null null) overlays)
|
||||
)
|
||||
);
|
||||
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 { };
|
||||
steamcompmgr =
|
||||
prev.callPackage ./applications/window-managers/steamcompmgr { };
|
||||
miningcore = prev.callPackage ./applications/blockchains/miningcore { };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue