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

View file

@ -4,7 +4,7 @@
inputs =
{
nixos.url = "nixpkgs/nixos-unstable";
override.url = "nixpkgs";
latest.url = "nixpkgs";
devos.url = "path:./lib"; # TODO: outfactor into separate repo
devos.inputs = {
nixpkgs.follows = "nixos";
@ -17,38 +17,74 @@
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.inputs.nixpkgs.follows = "override";
darwin.inputs.nixpkgs.follows = "latest";
flake-compat.url = "github:BBBSnowball/flake-compat/pr-1";
flake-compat.flake = false;
home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixos";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "override";
naersk.inputs.nixpkgs.follows = "latest";
nixos-hardware.url = "github:nixos/nixos-hardware";
pkgs.url = "path:./pkgs";
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 {
inherit self inputs nixos;
hosts = ./hosts;
packages = import ./pkgs;
suites = import ./profiles/suites.nix;
extern = import ./extern;
overrides = import ./extern/overrides.nix;
overlays = ./overlays;
profiles = ./profiles;
userProfiles = ./users/profiles;
modules = import ./modules/module-list.nix;
userModules = import ./users/modules/module-list.nix;
} // {
defaultTemplate = self.templates.flk;
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
overlays = nixos.lib.flatten [
(devos.lib.pathsIn ./overlays)
pkgs.overlay
./overrides.nix # from "latest" channel
nur.overlay
];
};
latest = { };
};
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;
};
};
}