Merge remote-tracking branch 'upstream/develop' into terra

This commit is contained in:
dusk 2021-07-24 16:50:17 +03:00
commit 6402cb4f35
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
26 changed files with 524 additions and 385 deletions

4
.gitignore vendored
View File

@ -1,6 +1,4 @@
result result
up
hosts/up-*
.direnv .direnv
doc/index.html doc/index.html
@ -8,3 +6,5 @@ doc/index.html
vm vm
iso iso
doi doi
pkgs/_sources/.shake*

View File

@ -31,5 +31,6 @@
- [Integrations](./integrations/index.md) - [Integrations](./integrations/index.md)
- [Cachix](./integrations/cachix.md) - [Cachix](./integrations/cachix.md)
- [Deploy RS](./integrations/deploy.md) - [Deploy RS](./integrations/deploy.md)
- [NvFetcher](./integrations/nvfetcher.md)
- [Hercules CI](./integrations/hercules.md) - [Hercules CI](./integrations/hercules.md)
- [Contributing](./CONTRIBUTING.md) - [Contributing](./CONTRIBUTING.md)

View File

@ -0,0 +1,43 @@
# nvfetcher
[NvFetcher][nvf] is a workflow companion for updating nix sources.
You can specify an origin source and an update configuration, and
nvfetcher can for example track updates to a specific branch and
automatically update your nix sources configuration on each run
to the tip of that branch.
All package source declaration is done in [sources.toml][sources.toml].
From within the devshell of this repo, run `nvfetcher`, a wrapped
version of `nvfetcher` that knows where to find and place its files
and commit the results.
## Usage
Statically fetching (not tracking) a particular tag from a github repo:
```toml
[manix]
src.manual = "v0.6.3"
fetch.github = "mlvzk/manix"
```
Tracking the latest github _release_ from a github repo:
```toml
[manix]
src.github = "mlvzk/manix" # responsible for tracking
fetch.github = "mlvzk/manix" # responsible for fetching
```
Tracking the latest commit of a git repository and fetch from a git repo:
```toml
[manix]
src.git = "https://github.com/mlvzk/manix.git" # responsible for tracking
fetch.git = "https://github.com/mlvzk/manix.git" # responsible for fetching
```
> ##### _Note:_
> Please refer to the [NvFetcher Readme][nvf-readme] for more options.
[nvf: https://github.com/berberman/nvfetcher
[nvf-readme]: https://github.com/berberman/nvfetcher#readme
[sources.toml]: https://github.com/divnix/devos/tree/core/pkgs/sources.toml

View File

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1620877075, "lastModified": 1626960455,
"narHash": "sha256-XvgTqtmQZHegu9UMDSR50gK5cHEM2gbnRH0qecmdN54=", "narHash": "sha256-N3+qOtsADo59UcG8PxqNMhT94wqTQ73k08gpy1dLaWU=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "e543aa7d68f222e1e771165da9e9a64b5bf7b3e3", "rev": "fb00f178b3a49a39cc964049075439b575d36d60",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,6 +20,45 @@
"type": "github" "type": "github"
} }
}, },
"blank": {
"locked": {
"lastModified": 1625557891,
"narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=",
"owner": "divnix",
"repo": "blank",
"rev": "5a5d2684073d9f563072ed07c871d577a6c614a8",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "blank",
"type": "github"
}
},
"bud": {
"inputs": {
"devshell": [
"digga",
"devshell"
],
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1626840404,
"narHash": "sha256-6HKRxPlVO4iKyPNAjkjku3JzGX1lgJ+93ieWAx7MY60=",
"owner": "divnix",
"repo": "bud",
"rev": "452ec18574b6e4d8b8a6aae9e190255d4c89768c",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "bud",
"type": "github"
}
},
"cachix": { "cachix": {
"locked": { "locked": {
"lastModified": 1625876282, "lastModified": 1625876282,
@ -36,34 +75,6 @@
"type": "github" "type": "github"
} }
}, },
"ci-agent": {
"inputs": {
"flake-compat": "flake-compat",
"nix-darwin": [
"darwin"
],
"nixos-20_09": [
"nixos"
],
"nixos-unstable": [
"latest"
],
"pre-commit-hooks-nix": "pre-commit-hooks-nix"
},
"locked": {
"lastModified": 1626066948,
"narHash": "sha256-rBo4nCPyAHb1e/9ysYGH7tW1FV0N2XNvRcJR+g8gugA=",
"owner": "hercules-ci",
"repo": "hercules-ci-agent",
"rev": "7f3265cc42d5f364066c145939ee2812938b991c",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "hercules-ci-agent",
"type": "github"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -86,17 +97,21 @@
}, },
"deploy": { "deploy": {
"inputs": { "inputs": {
"flake-compat": "flake-compat_2", "flake-compat": "flake-compat",
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": "nixpkgs", "nixpkgs": [
"utils": "utils" "nixpkgs"
],
"utils": [
"flake-utils"
]
}, },
"locked": { "locked": {
"lastModified": 1616406726, "lastModified": 1625729093,
"narHash": "sha256-n9zmgxR03QNrvs9/fHewqE0j3SjL7Y+cglBCFu3U3rg=", "narHash": "sha256-hpo8T7mlVEpHpZIYqhxqt5i/XY8eu4p66MrAg/MCuVY=",
"owner": "serokell", "owner": "serokell",
"repo": "deploy-rs", "repo": "deploy-rs",
"rev": "9e405fbc5ab5bacbd271fd78c6b6b6877c4d9f8d", "rev": "587cbcfe8d3ea05c5bb153764d3617012ef28c86",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -107,11 +122,11 @@
}, },
"devshell": { "devshell": {
"locked": { "locked": {
"lastModified": 1622013274, "lastModified": 1625086391,
"narHash": "sha256-mK/Lv0lCbl07dI5s7tR/7nb79HunKnJik3KyR6yeI2k=", "narHash": "sha256-IpNPv1v8s4L3CoxhwcgZIitGpcrnNgnj09X7TA0QV3k=",
"owner": "numtide", "owner": "numtide",
"repo": "devshell", "repo": "devshell",
"rev": "e7faf69e6bf8546517cc936c7f6d31c7eb3abcb2", "rev": "4b5ac7cf7d9a1cc60b965bb51b59922f2210cbc7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -122,23 +137,32 @@
}, },
"digga": { "digga": {
"inputs": { "inputs": {
"blank": "blank",
"deploy": "deploy", "deploy": "deploy",
"devshell": "devshell", "devshell": "devshell",
"nixlib": "nixlib", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2", "flake-utils-plus": "flake-utils-plus",
"utils": "utils_2" "home-manager": [
"home"
],
"nixlib": [
"nixos"
],
"nixos-generators": "nixos-generators",
"nixpkgs": [
"nixos"
]
}, },
"locked": { "locked": {
"lastModified": 1623197477, "lastModified": 1627072303,
"narHash": "sha256-2Qk/uIHb1nXre2rRlGonAJmpuamBs7RRfgXhMmS5JkU=", "narHash": "sha256-XMrOWqYLLMVcTiTzzgaugUUSqlIRj3/l4JGrs1cvgMU=",
"owner": "divnix", "owner": "divnix",
"repo": "digga", "repo": "digga",
"rev": "f69703abc33f221b676966a8435c4f09ef70ff49", "rev": "cba3f8f76b7fd6816625d9e2e033bfa3462d7125",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "divnix", "owner": "divnix",
"ref": "master",
"repo": "digga", "repo": "digga",
"type": "github" "type": "github"
} }
@ -159,34 +183,39 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": { "flake-utils": {
"flake": false,
"locked": { "locked": {
"lastModified": 1606424373, "lastModified": 1623875721,
"narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=", "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "edolstra", "owner": "numtide",
"repo": "flake-compat", "repo": "flake-utils",
"rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf", "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "edolstra", "owner": "numtide",
"repo": "flake-compat", "repo": "flake-utils",
"type": "github" "type": "github"
} }
}, },
"flake-utils": { "flake-utils-plus": {
"inputs": {
"flake-utils": [
"flake-utils"
]
},
"locked": { "locked": {
"lastModified": 1620759905, "lastModified": 1627071952,
"narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", "narHash": "sha256-FhE0KOuI9Kl4eyGJXu4bh9fBP2hbxjnD1DlKHljCcYs=",
"owner": "numtide", "owner": "gytis-ivaskevicius",
"repo": "flake-utils", "repo": "flake-utils-plus",
"rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", "rev": "51a82925db31073bc4822c9b538a0a3ebf1134b2",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "gytis-ivaskevicius",
"repo": "flake-utils", "ref": "staging",
"repo": "flake-utils-plus",
"type": "github" "type": "github"
} }
}, },
@ -212,25 +241,26 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1626073055, "lastModified": 1624228557,
"narHash": "sha256-vocByfpVu6m9zvtJugDvmd6/9iT2HJuG4tmDICKd0lI=", "narHash": "sha256-wwOqe73BsrXfRv1PhyXQFNC8iTET50KvE/HitdkRgxs=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "775cb20bd4af7781fbf336fb201df02ee3d544bb", "rev": "35a24648d155843a4d162de98c17b1afd5db51e4",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-21.05",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
}, },
"latest": { "latest": {
"locked": { "locked": {
"lastModified": 1625874246, "lastModified": 1626046891,
"narHash": "sha256-7cGgcysIXz/j/lRpJn7cNJjf0+k7sQ5EuGn62252Svw=", "narHash": "sha256-Zt8saH+hAehXskW0iFAzk+iMillYoFBxvLReYNqGT9E=",
"path": "/nix/store/7aa32jz0nkywhr9lyrz37w444hra9631-source", "path": "/nix/store/hv23pdsi6n7z96pkljv25lfrfh1mnzz7-source",
"rev": "45fc7d4a35c5343e58541a7847f6415654ccbb37", "rev": "d8f8f31af9d77a48220e4e8a301d1e79774cb7d2",
"type": "path" "type": "path"
}, },
"original": { "original": {
@ -245,11 +275,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1610392286, "lastModified": 1622810282,
"narHash": "sha256-3wFl5y+4YZO4SgRYK8WE7JIS3p0sxbgrGaQ6RMw+d98=", "narHash": "sha256-4wmvM3/xfD0hCdNDIXVzRMfL4yB1J+DjH6Zte2xbAxk=",
"owner": "nmattia", "owner": "nmattia",
"repo": "naersk", "repo": "naersk",
"rev": "d7bfbad3304fd768c0f93a4c3b50976275e6d4be", "rev": "e8061169e1495871b56be97c5c51d310fae01374",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -300,21 +330,6 @@
"type": "github" "type": "github"
} }
}, },
"nixlib": {
"locked": {
"lastModified": 1620519687,
"narHash": "sha256-+6Dd72b2CASuXm2W7KRxZIE7AOy/dj4mU28vaF+zxcs=",
"owner": "divnix",
"repo": "nixpkgs.lib",
"rev": "c7b6169809c5f74dd0c34f3d69e9d12ba4d448de",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos": { "nixos": {
"locked": { "locked": {
"lastModified": 1626852498, "lastModified": 1626852498,
@ -330,6 +345,29 @@
"type": "indirect" "type": "indirect"
} }
}, },
"nixos-generators": {
"inputs": {
"nixlib": [
"nixlib"
],
"nixpkgs": [
"blank"
]
},
"locked": {
"lastModified": 1624973746,
"narHash": "sha256-11JbJRduNwyf556gndGErR5/12ceyHOHBfEuha5Vws4=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "022ef440af8dc237ab1f59fa363cb1e25783ec3e",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1625333638, "lastModified": 1625333638,
@ -360,22 +398,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": {
"locked": {
"lastModified": 1610942247,
"narHash": "sha256-PKo1ATAlC6BmfYSRmX0TVmNoFbrec+A5OKcabGEu2yU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7d71001b796340b219d1bfa8552c81995017544a",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgsWayland": { "nixpkgsWayland": {
"inputs": { "inputs": {
"cachix": "cachix", "cachix": "cachix",
@ -384,11 +406,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1626290283, "lastModified": 1626505081,
"narHash": "sha256-2RjWMFA9fYdLkyvBj2oUUUygZm461kW4r3cB4Txo+xA=", "narHash": "sha256-dcKU/hs4EIJIJu5nNqtX169nw+eHT6lIrNmOvg/Io4s=",
"owner": "colemickens", "owner": "colemickens",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "09d4d9c873d48a13f15b7d950948131a4bdb3028", "rev": "fd3be17ace1aa22ed6b1d0bd01a979deb098cbbd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -397,21 +419,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1620962350,
"narHash": "sha256-9ASW4d4/Z8HmRvuJI8rxbEOTbXTBpQ8y+CmFYBwtXzE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5d4a430472cafada97888cc80672fab255231f57",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1622199699, "lastModified": 1622199699,
@ -425,48 +432,66 @@
"type": "indirect" "type": "indirect"
} }
}, },
"pkgs": { "nvfetcher": {
"inputs": { "inputs": {
"flake-compat": [
"digga",
"deploy",
"flake-compat"
],
"flake-utils": [
"digga",
"flake-utils-plus",
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixos" "latest"
] ]
}, },
"locked": { "locked": {
"narHash": "sha256-Zs7dc0dNNa0Z3//+Gckxj7SKrMqVovY0xZZ1z8xWnEg=", "lastModified": 1627126476,
"path": "./pkgs", "narHash": "sha256-WvUITmKad4aqtSgICVgwpasrCcAd5yrdCF+27Hz4+bw=",
"type": "path" "owner": "berberman",
}, "repo": "nvfetcher",
"original": { "rev": "5a44a2b0675108d1abd0c8c820b20593b65c9512",
"path": "./pkgs",
"type": "path"
}
},
"pre-commit-hooks-nix": {
"flake": false,
"locked": {
"lastModified": 1622650193,
"narHash": "sha256-qSzUpJDv04ajS9FXoCq6NjVF3qOt9IiGIiGh0P8amyw=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "0398f0649e0a741660ac5e8216760bae5cc78579",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "cachix", "owner": "berberman",
"repo": "pre-commit-hooks.nix", "repo": "nvfetcher",
"type": "github" "type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"ci-agent": "ci-agent", "blank": [
"digga",
"blank"
],
"bud": "bud",
"darwin": "darwin", "darwin": "darwin",
"deploy": [
"digga",
"deploy"
],
"digga": "digga", "digga": "digga",
"flake-utils": [
"digga",
"flake-utils"
],
"flake-utils-plus": [
"digga",
"flake-utils-plus"
],
"home": "home", "home": "home",
"latest": "latest", "latest": "latest",
"naersk": "naersk_2", "naersk": "naersk_2",
"nixEvalLsp": "nixEvalLsp", "nixEvalLsp": "nixEvalLsp",
"nixlib": [
"digga",
"nixlib"
],
"nixos": "nixos", "nixos": "nixos",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixosPersistence": "nixosPersistence", "nixosPersistence": "nixosPersistence",
@ -475,41 +500,7 @@
], ],
"nixpkgsWayland": "nixpkgsWayland", "nixpkgsWayland": "nixpkgsWayland",
"nur": "nur", "nur": "nur",
"pkgs": "pkgs" "nvfetcher": "nvfetcher"
}
},
"utils": {
"locked": {
"lastModified": 1610051610,
"narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"utils_2": {
"inputs": {
"flake-utils": "flake-utils"
},
"locked": {
"lastModified": 1622583383,
"narHash": "sha256-2DFx619SNfjzYwqx1ryae8zHnTh+N7VsZkbtAbrYIIA=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "6b2ea4b02cad77fac581c6a9ec4f822ba87dce5c",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"ref": "staging",
"repo": "flake-utils-plus",
"type": "github"
} }
} }
}, },

115
flake.nix
View File

@ -1,29 +1,45 @@
{ {
description = "A highly structured configuration database."; description = "A highly structured configuration database.";
nixConfig.extra-experimental-features = "nix-command flakes ca-references";
nixConfig.extra-substituters = "https://nrdxp.cachix.org https://nix-community.cachix.org";
nixConfig.extra-trusted-public-keys = "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=";
inputs = inputs =
{ {
nixos.url = "nixpkgs/nixos-unstable"; nixos.url = "nixpkgs/nixos-unstable";
nixpkgs.follows = "nixos";
latest.url = "nixpkgs"; latest.url = "nixpkgs";
digga.url = "github:divnix/digga/master";
ci-agent = { digga.url = "github:divnix/digga";
url = "github:hercules-ci/hercules-ci-agent"; digga.inputs.nixpkgs.follows = "nixos";
inputs = { nix-darwin.follows = "darwin"; nixos-20_09.follows = "nixos"; nixos-unstable.follows = "latest"; }; digga.inputs.nixlib.follows = "nixos";
}; digga.inputs.home-manager.follows = "home";
bud.url = "github:divnix/bud";
bud.inputs.nixpkgs.follows = "nixos";
bud.inputs.devshell.follows = "digga/devshell";
home.url = "github:nix-community/home-manager/release-21.05";
home.inputs.nixpkgs.follows = "nixos";
darwin.url = "github:LnL7/nix-darwin"; darwin.url = "github:LnL7/nix-darwin";
darwin.inputs.nixpkgs.follows = "latest"; darwin.inputs.nixpkgs.follows = "latest";
home.url = "github:nix-community/home-manager";
home.inputs.nixpkgs.follows = "nixos"; deploy.follows = "digga/deploy";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "latest";
agenix.url = "github:ryantm/agenix"; agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "latest"; agenix.inputs.nixpkgs.follows = "latest";
nvfetcher.url = "github:berberman/nvfetcher";
nvfetcher.inputs.nixpkgs.follows = "latest";
nvfetcher.inputs.flake-compat.follows = "digga/deploy/flake-compat";
nvfetcher.inputs.flake-utils.follows = "digga/flake-utils-plus/flake-utils";
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "latest";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
pkgs.url = "path:./pkgs";
pkgs.inputs.nixpkgs.follows = "nixos";
nixosPersistence.url = "github:nix-community/impermanence"; nixosPersistence.url = "github:nix-community/impermanence";
nixEvalLsp = { nixEvalLsp = {
url = "github:aaronjanse/nix-eval-lsp"; url = "github:aaronjanse/nix-eval-lsp";
@ -33,14 +49,21 @@
url = "github:colemickens/nixpkgs-wayland"; url = "github:colemickens/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixos"; inputs.nixpkgs.follows = "nixos";
}; };
# start ANTI CORRUPTION LAYER
# remove after https://github.com/NixOS/nix/pull/4641
nixpkgs.follows = "nixos";
nixlib.follows = "digga/nixlib";
blank.follows = "digga/blank";
flake-utils-plus.follows = "digga/flake-utils-plus";
flake-utils.follows = "digga/flake-utils";
# end ANTI CORRUPTION LAYER
}; };
outputs = outputs =
{ self { self
, pkgs
, digga , digga
, bud
, nixos , nixos
, ci-agent
, home , home
, nixos-hardware , nixos-hardware
, nur , nur
@ -48,36 +71,36 @@
, nixosPersistence , nixosPersistence
, nixpkgsWayland , nixpkgsWayland
, nixEvalLsp , nixEvalLsp
, nvfetcher
, deploy
, ... , ...
} @ inputs: } @ inputs:
digga.lib.mkFlake { digga.lib.mkFlake
{
inherit self inputs; inherit self inputs;
lib = import ./lib { lib = digga.lib // nixos.lib; }; channelsConfig = { allowUnfree = true; };
channelsConfig = {
allowUnfree = true;
};
channels = { channels = {
nixos = { nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ]; imports = [ (digga.lib.importOverlays ./overlays) ];
overlays = [ overlays = [
./pkgs/default.nix digga.overlays.patchedNix
pkgs.overlay # for `srcs`
nur.overlay nur.overlay
nixpkgsWayland.overlay
(final: prev: {
inherit (nixEvalLsp.packages.${prev.system}) nix-eval-lsp;
})
agenix.overlay agenix.overlay
nvfetcher.overlay
deploy.overlay
./pkgs/default.nix
]; ];
}; };
latest = { }; latest = { };
}; };
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [ sharedOverlays = [
(final: prev: { (final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: { lib = prev.lib.extend (lfinal: lprev: {
our = self.lib; our = self.lib;
}); });
@ -88,24 +111,27 @@
hostDefaults = { hostDefaults = {
system = "x86_64-linux"; system = "x86_64-linux";
channelName = "nixos"; channelName = "nixos";
modules = ./modules/module-list.nix; imports = [ (digga.lib.importModules ./modules) ];
externalModules = [ externalModules = [
{ _module.args.ourLib = self.lib; } { lib.our = self.lib; }
ci-agent.nixosModules.agent-profile digga.nixosModules.bootstrapIso
digga.nixosModules.nixConfig
home.nixosModules.home-manager home.nixosModules.home-manager
nixosPersistence.nixosModules.impermanence
agenix.nixosModules.age agenix.nixosModules.age
./modules/customBuilds.nix bud.nixosModules.bud
nixosPersistence.nixosModules.impermanence
]; ];
}; };
imports = [ (digga.lib.importers.hosts ./hosts) ]; imports = [ (digga.lib.importHosts ./hosts) ];
hosts = { hosts = {
/* set host specific properties here */ /* set host specific properties here */
NixOS = { }; NixOS = { };
}; };
importables = rec { importables = rec {
profiles = (digga.lib.importers.rakeLeaves ./profiles) // { users = digga.lib.importers.rakeLeaves ./users; }; profiles = digga.lib.rakeLeaves ./profiles // {
users = digga.lib.rakeLeaves ./users;
};
suites = with profiles; { suites = with profiles; {
base = [ cachix core users.root ]; base = [ cachix core users.root ];
work = [ users.patriot develop ]; work = [ users.patriot develop ];
@ -114,27 +140,30 @@
}; };
home = { home = {
modules = ./users/modules/module-list.nix; imports = [ (digga.lib.importModules ./users/modules) ];
externalModules = [ ]; externalModules = [ ];
importables = rec { importables = rec {
profiles = digga.lib.importers.rakeLeaves ./users/profiles; profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; { suites = with profiles; rec {
base = [ direnv git starship ]; base = [ direnv git starship ];
}; };
}; };
}; };
devshell.externalModules = { pkgs, ... }: { devshell = ./shell;
packages = [ pkgs.agenix ];
};
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { };
defaultTemplate = self.templates.flk; defaultTemplate = self.templates.bud;
templates.flk.path = ./.; templates.bud.path = ./.;
templates.flk.description = "flk template"; templates.bud.description = "bud template";
}
//
{
budModules = { devos = import ./pkgs/bud; };
} }
; ;
} }

View File

@ -1,33 +0,0 @@
{ lib, self, diggaLib, config, modules, channel, ... }:
let
mkBuild = buildModule:
# TODO: get specialArgs as a module argument and drop builderArgs usage
channel.input.lib.nixosSystem (diggaLib.mergeAny config.lib.builderArgs {
modules = [ buildModule ];
});
in
{
system.build = {
iso = (mkBuild (diggaLib.modules.isoConfig {
inherit self;
fullHostConfig = config;
})).config.system.build.isoImage;
homes = (mkBuild ({ config, ... }: {
home-manager.useUserPackages = lib.mkForce false;
home-manager.sharedModules = [
{
home.sessionVariables = {
inherit (config.environment.sessionVariables) NIX_PATH;
};
xdg.configFile."nix/registry.json".text =
config.environment.etc."nix/registry.json".text;
}
];
})).config.home-manager.users;
digitalOcean = (mkBuild ({ modulesPath, ... }: {
imports = [ "${modulesPath}/virtualisation/digital-ocean-image.nix" ];
})).config.system.build.digitalOceanImage;
};
}

View File

@ -0,0 +1,11 @@
{ config, ... }: {
home-manager.sharedModules = [
{
home.sessionVariables = {
inherit (config.environment.sessionVariables) NIX_PATH;
};
xdg.configFile."nix/registry.json".text =
config.environment.etc."nix/registry.json".text;
}
];
}

7
modules/nix-path.nix Normal file
View File

@ -0,0 +1,7 @@
{ channel, inputs, ... }: {
nix.nixPath = [
"nixpkgs=${channel.input}"
"nixos-config=${../lib/compat/nixos}"
"home-manager=${inputs.home}"
];
}

5
overlays/manix.nix Normal file
View File

@ -0,0 +1,5 @@
final: prev: {
manix = prev.manix.overrideAttrs (o: rec{
inherit (prev.sources.manix) pname version src;
});
}

View File

@ -6,13 +6,13 @@ channels: final: prev: {
dhall dhall
discord discord
element-desktop element-desktop
manix
rage rage
nixpkgs-fmt nixpkgs-fmt
qutebrowser qutebrowser
signal-desktop signal-desktop
starship; starship;
<<<<<<< HEAD
haskellPackages = prev.haskellPackages.override { haskellPackages = prev.haskellPackages.override {
overrides = hfinal: hprev: overrides = hfinal: hprev:
let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version;
@ -23,4 +23,18 @@ channels: final: prev: {
haskell-language-server; haskell-language-server;
}; };
}; };
=======
haskellPackages = prev.haskellPackages.override
(old: {
overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) (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;
});
});
>>>>>>> upstream/develop
} }

View File

@ -0,0 +1,11 @@
final: prev: {
# Since: https://github.com/NixOS/nixpkgs/pull/126137
nix-direnv =
if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs
then
prev.nix-direnv.override
{
enableFlakes = true;
}
else prev.nix-direnv;
}

View File

@ -0,0 +1,17 @@
# This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl }:
{
manix = {
pname = "manix";
version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
src = fetchgit {
url = "https://github.com/mlvzk/manix";
rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = false;
sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs";
};
};
}

10
pkgs/bud/default.nix Normal file
View File

@ -0,0 +1,10 @@
{ pkgs, lib, budUtils, ... }: {
bud.cmds = with pkgs; {
get = {
writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ];
synopsis = "get [DEST]";
help = "Copy the desired template to DEST";
script = ./get.bash;
};
};
}

1
pkgs/bud/get.bash Normal file
View File

@ -0,0 +1 @@
nix flake new -t "github:divnix/devos/core" "${2:-devos}"

View File

@ -1 +1,5 @@
final: prev: { } final: prev: {
# keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { };
# then, call packages with `final.callPackage`
}

View File

@ -1,25 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1615926763,
"narHash": "sha256-yeq8A3EPNuQVlsxlEQrIRsklfJwJK0Us6jtcG/u8wNs=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "b702a56d417647de4090ac56c0f18bdc7e646610",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View File

@ -1,52 +0,0 @@
{
description = "Package Sources";
inputs = { };
outputs = { self, nixpkgs, ... }: {
overlay = final: prev: {
inherit (self) srcs;
};
srcs =
let
inherit (nixpkgs) lib;
mkVersion = name: input:
let
inputs = (builtins.fromJSON
(builtins.readFile ./flake.lock)).nodes;
ref =
if lib.hasAttrByPath [ name "original" "ref" ] inputs
then inputs.${name}.original.ref
else "";
version =
let version' = builtins.match
"[[:alpha:]]*[-._]?([0-9]+(\.[0-9]+)*)+"
ref;
in
if lib.isList version'
then lib.head version'
else if input ? lastModifiedDate && input ? shortRev
then "${lib.substring 0 8 input.lastModifiedDate}_${input.shortRev}"
else null;
in
version;
in
lib.mapAttrs
(pname: input:
let
version = mkVersion pname input;
in
input // { inherit pname; }
// lib.optionalAttrs (! isNull version)
{
inherit version;
}
)
(lib.filterAttrs (n: _: n != "nixpkgs")
self.inputs);
};
}

4
pkgs/sources.toml Normal file
View File

@ -0,0 +1,4 @@
# nvfetcher.toml
[manix]
src.git = "https://github.com/mlvzk/manix"
fetch.github = "mlvzk/manix"

View File

@ -26,7 +26,7 @@ in
dosfstools dosfstools
fd fd
git git
gotop bottom
gptfdisk gptfdisk
iputils iputils
jq jq

10
shell/default.nix Normal file
View File

@ -0,0 +1,10 @@
{ self, inputs, ... }:
{
externalModules = with inputs; [
bud.devshellModules.bud
];
modules = [
./devos.nix
];
}

61
shell/devos.nix Normal file
View File

@ -0,0 +1,61 @@
{ pkgs, extraModulesPath, ... }:
let
hooks = import ./hooks;
pkgWithCategory = category: package: { inherit package category; };
linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos";
in
{
_file = toString ./.;
imports = [ "${extraModulesPath}/git/hooks.nix" ];
git = { inherit hooks; };
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry ''
# PATH is devshell's exorbitant privilige:
# fence against its pollution
_PATH=''${PATH}
# Load installed profiles
for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do
# If that folder doesn't exist, bash loves to return the whole glob
[[ -f "$file" ]] && source "$file"
done
# Exert exorbitant privilige and leave no trace
export PATH=''${_PATH}
unset _PATH
'');
packages = with pkgs; [
git-crypt
];
commands = with pkgs; [
(devos nixUnstable)
(devos agenix)
{
category = "devos";
name = pkgs.nvfetcher-bin.pname;
help = pkgs.nvfetcher-bin.meta.description;
command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@; nixpkgs-fmt _sources/";
}
(linter nixpkgs-fmt)
(linter editorconfig-checker)
# (docs python3Packages.grip) too many deps
(docs mdbook)
]
++ lib.optional
(pkgs ? deploy-rs)
(devos deploy-rs.deploy-rs)
++ lib.optional
(system != "i686-linux")
(devos cachix)
;
}

4
shell/hooks/default.nix Normal file
View File

@ -0,0 +1,4 @@
{
enable = true;
pre-commit.text = builtins.readFile ./pre-commit.sh;
}

29
shell/hooks/pre-commit.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(${git}/bin/git hash-object -t tree /dev/null)
fi
diff="git diff-index --name-only --cached $against --diff-filter d"
nix_files=($($diff -- '*.nix'))
all_files=($($diff))
# Format staged nix files.
if [[ -n "${nix_files[@]}" ]]; then
nixpkgs-fmt "${nix_files[@]}" \
&& git add "${nix_files[@]}"
fi
# check editorconfig
editorconfig-checker -- "${all_files[@]}"
if [[ $? != '0' ]]; then
printf "%b\n" \
"\nCode is not aligned with .editorconfig" \
"Review the output and commit your fixes" >&2
exit 1
fi

View File

View File

@ -1 +0,0 @@
[ ]

View File

@ -1,8 +1,6 @@
{ ... }: { hmUsers, ... }:
{ {
home-manager.users.nixos = { suites, ... }: { home-manager.users = { inherit (hmUsers) nixos; };
imports = suites.base;
};
users.users.nixos = { users.users.nixos = {
uid = 1000; uid = 1000;