update devos template to use new api

This commit is contained in:
David Arnold 2021-04-21 22:44:15 -05:00 committed by Pacman99
parent dceac02b36
commit c3d8805ad6
5 changed files with 103 additions and 99 deletions

25
extern/default.nix vendored
View File

@ -1,25 +0,0 @@
{ inputs }: with inputs;
{
modules = [
home.nixosModules.home-manager
ci-agent.nixosModules.agent-profile
];
overlays = [
nur.overlay
pkgs.overlay
];
# passed to all nixos modules
specialArgs = {
overrideModulesPath = "${override}/nixos/modules";
hardware = nixos-hardware.nixosModules;
};
# added to home-manager
userModules = [
];
# passed to all home-manager modules
userSpecialArgs = { };
}

33
extern/overrides.nix vendored
View File

@ -1,33 +0,0 @@
# override defaults to nixpkgs/master
{
# modules to pull from override, stable version is automatically disabled
modules = [ ];
# if a modules name changed in override, add the old name here
disabledModules = [ ];
# packages pulled from override
packages = pkgs: final: prev: {
inherit (pkgs)
cachix
dhall
discord
element-desktop
manix
nixpkgs-fmt
qutebrowser
signal-desktop
starship;
haskellPackages = prev.haskellPackages.override {
overrides = hfinal: hprev:
let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version;
in
{
# same for haskell packages, matching ghc versions
inherit (pkgs.haskell.packages."ghc${version}")
haskell-language-server;
};
};
};
}

View File

@ -12,7 +12,7 @@
"nixos" "nixos"
], ],
"nixos-unstable": [ "nixos-unstable": [
"override" "latest"
], ],
"pre-commit-hooks-nix": "pre-commit-hooks-nix" "pre-commit-hooks-nix": "pre-commit-hooks-nix"
}, },
@ -33,7 +33,7 @@
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"override" "latest"
] ]
}, },
"locked": { "locked": {
@ -81,7 +81,7 @@
"utils": "utils_2" "utils": "utils_2"
}, },
"locked": { "locked": {
"narHash": "sha256-y0IZEAqpQpdGhxfc6REAT2PY2nEbikusUlXCRv264vI=", "narHash": "sha256-MvrBYZG6sZqpa8mTg4RYeD9aezYbVppBnslRyH7qZys=",
"path": "./lib", "path": "./lib",
"type": "path" "type": "path"
}, },
@ -173,10 +173,24 @@
"type": "github" "type": "github"
} }
}, },
"latest": {
"locked": {
"lastModified": 1619400530,
"narHash": "sha256-7ZO7B+b9i1wFbHw62EFT+iwuBBpXeA/fcHlR63Z4J0w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e8dc8adab655eb27957859c62bef11484b53f639",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"naersk": { "naersk": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"override" "latest"
] ]
}, },
"locked": { "locked": {
@ -197,7 +211,7 @@
"naersk_2": { "naersk_2": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"override" "latest"
] ]
}, },
"locked": { "locked": {
@ -274,20 +288,6 @@
"type": "indirect" "type": "indirect"
} }
}, },
"override": {
"locked": {
"lastModified": 1615926763,
"narHash": "sha256-yeq8A3EPNuQVlsxlEQrIRsklfJwJK0Us6jtcG/u8wNs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b702a56d417647de4090ac56c0f18bdc7e646610",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"pkgs": { "pkgs": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -327,11 +327,11 @@
"devos": "devos", "devos": "devos",
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat_2",
"home": "home", "home": "home",
"latest": "latest",
"naersk": "naersk_2", "naersk": "naersk_2",
"nixos": "nixos", "nixos": "nixos",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nur": "nur", "nur": "nur",
"override": "override",
"pkgs": "pkgs" "pkgs": "pkgs"
} }
}, },

View File

@ -4,7 +4,7 @@
inputs = inputs =
{ {
nixos.url = "nixpkgs/nixos-unstable"; nixos.url = "nixpkgs/nixos-unstable";
override.url = "nixpkgs"; latest.url = "nixpkgs";
devos.url = "path:./lib"; # TODO: outfactor into separate repo devos.url = "path:./lib"; # TODO: outfactor into separate repo
devos.inputs = { devos.inputs = {
nixpkgs.follows = "nixos"; nixpkgs.follows = "nixos";
@ -17,38 +17,74 @@
ci-agent = { ci-agent = {
url = "github:hercules-ci/hercules-ci-agent"; url = "github:hercules-ci/hercules-ci-agent";
inputs = { nix-darwin.follows = "darwin"; flake-compat.follows = "flake-compat"; nixos-20_09.follows = "nixos"; nixos-unstable.follows = "override"; }; inputs = { nix-darwin.follows = "darwin"; flake-compat.follows = "flake-compat"; nixos-20_09.follows = "nixos"; nixos-unstable.follows = "latest"; };
}; };
darwin.url = "github:LnL7/nix-darwin"; darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "override"; darwin.inputs.nixpkgs.follows = "latest";
flake-compat.url = "github:BBBSnowball/flake-compat/pr-1"; flake-compat.url = "github:BBBSnowball/flake-compat/pr-1";
flake-compat.flake = false; flake-compat.flake = false;
home.url = "github:nix-community/home-manager"; home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixos"; home.inputs.nixpkgs.follows = "nixos";
naersk.url = "github:nmattia/naersk"; naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "override"; naersk.inputs.nixpkgs.follows = "latest";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
pkgs.url = "path:./pkgs"; pkgs.url = "path:./pkgs";
pkgs.inputs.nixpkgs.follows = "nixos"; pkgs.inputs.nixpkgs.follows = "nixos";
}; };
outputs = inputs@{ self, devos, nixos, nur, ... }: outputs = inputs@{ self, pkgs, devos, nixos, ci-agent, home, nixos-hardware, nur, ... }:
devos.lib.mkFlake { devos.lib.mkFlake {
inherit self inputs nixos; inherit self inputs;
hosts = ./hosts;
packages = import ./pkgs; channelsConfig = { allowUnfree = true; };
suites = import ./profiles/suites.nix;
extern = import ./extern; channels = {
overrides = import ./extern/overrides.nix; nixos = {
overlays = ./overlays; overlays = nixos.lib.flatten [
profiles = ./profiles; (devos.lib.pathsIn ./overlays)
userProfiles = ./users/profiles; pkgs.overlay
modules = import ./modules/module-list.nix; ./overrides.nix # from "latest" channel
userModules = import ./users/modules/module-list.nix; nur.overlay
} // { ];
defaultTemplate = self.templates.flk; };
templates.flk.path = ./.; latest = { };
templates.flk.description = "flk template"; };
};
nixos = {
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
modules = ./modules/module-list.nix;
externalModules = [
ci-agent.nixosModules.agent-profile
home.nixosModules.home-manager
];
};
hosts = {
NixOS = {
modules = ./hosts/NixOS.nix;
};
};
profiles = [ ./profiles ./users ];
suites = { profiles, users, ... }: with profiles; {
base = [ core users.nixos users.root ];
};
};
home = {
modules = ./users/modules/module-list.nix;
externalModules = [ ];
profiles = [ ./users/profiles ];
suites = { profiles, ... }: with profiles; {
base = [ direnv git ];
};
};
#defaultTemplate = self.templates.flk;
templates.flk.path = ./.;
templates.flk.description = "flk template";
}
;
} }

26
overrides.nix Normal file
View File

@ -0,0 +1,26 @@
channels: final: prev: {
inherit (channels.latest)
cachix
dhall
discord
element-desktop
manix
nixpkgs-fmt
qutebrowser
signal-desktop
starship;
haskellPackages = prev.haskellPackages.override {
overrides = hfinal: hprev:
let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version;
in
{
# same for haskell packages, matching ghc versions
inherit (channels.latest.haskell.packages."ghc${version}")
haskell-language-server;
};
};
}