Merge pull request 'sync with latest core' (#12) from fix/sync-with-latest-core into core

Reviewed-on: https://git.b12f.io/pub-solar/os/pulls/12
Reviewed-by: Benjamin Bädorf <b12f@noreply.example.org>
This commit is contained in:
Benjamin Bädorf 2021-08-24 12:04:49 +00:00
commit 2a70461248
39 changed files with 743 additions and 566 deletions

10
.gitignore vendored
View file

@ -1,14 +1,12 @@
result result
up
hosts/up-*
.direnv .direnv
doc/index.html doc/index.html
<<<<<<< HEAD
tags
=======
# Result of flk commands # Result of flk commands
vm vm
iso iso
doi doi
>>>>>>> devos/core
pkgs/_sources/.shake*
tags

View file

@ -22,14 +22,18 @@ Also, have a look at [_flake.nix_][toc]. If anything is not immediately
discoverable via "[`digga`][digga]'s [`mkFlake`][mk-flake], discoverable via "[`digga`][digga]'s [`mkFlake`][mk-flake],
please file a bug report. please file a bug report.
### Status: Beta ## Motivation
Although this project has already matured quite a bit, especially through NixOS provides an amazing abstraction to manage our environment, but that new
recent outfactoring of [`digga`][digga], a fair amount of api polishing is still power can sometimes bring feelings of overwhelm and confusion. Having a turing
expected. There are unstable versions (0._x_._x_) to help users keep track complete system can easily lead to unlimited complexity if we do it wrong.
of changes and progress, and a [`develop`](https://github.com/divnix/devos/tree/develop) branch for the brave 😜 Instead, we should have a community consensus on how to manage a NixOS system
and its satellite projects, from which best practices can evolve.
## In the Wild ___The future is declarative! 🎉___
* The original [authors][please]
## Examples in the Wild
The author maintains his own branch, so you can take inspiration, direction, or
make critical comments about the [code][please]. 😜
## Shoulders ## Shoulders
This work does not reinvent the wheel. It stands on the [shoulders of the This work does not reinvent the wheel. It stands on the [shoulders of the
@ -43,6 +47,7 @@ following giants][giants]:
### :family: &mdash; like family ### :family: &mdash; like family
- [`numtide/devshell`][devshell] - [`numtide/devshell`][devshell]
- [`serokell/deploy-rs`][deploy] - [`serokell/deploy-rs`][deploy]
- [`berberman/nvfetcher`][nvfetcher]
- [`NixOS/nixpkgs`][nixpkgs] - [`NixOS/nixpkgs`][nixpkgs]
:heart: :heart:
@ -68,23 +73,23 @@ goals are sufficiently upstreamed into "the Nix", dissolved.
# License # License
DevOS is licensed under the [MIT License][mit]. DevOS is licensed under the [MIT License][mit].
[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake
[nixpkgs]: https://github.com/NixOS/nixpkgs
[deploy]: https://github.com/serokell/deploy-rs
[toc]: https://github.com/divnix/devos/blob/core/flake.nix
[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants
[digga]: https://github.com/divnix/digga
[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus
[fu]: https://github.com/numtide/flake-utils
[devshell]: https://github.com/numtide/devshell
[nix]: https://nixos.org/manual/nix/stable
[mit]: https://mit-license.org
[nixos]: https://nixos.org/manual/nixos/stable
[home-manager]: https://nix-community.github.io/home-manager
[flakes]: https://nixos.wiki/wiki/Flakes
[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
[core]: https://github.com/divnix/devos
[community]: https://github.com/divnix/devos/tree/community [community]: https://github.com/divnix/devos/tree/community
[core]: https://github.com/divnix/devos
[deploy]: https://github.com/serokell/deploy-rs
[devshell]: https://github.com/numtide/devshell
[digga]: https://github.com/divnix/digga
[dotfiles]: https://github.com/hlissner/dotfiles [dotfiles]: https://github.com/hlissner/dotfiles
[flake-doc]: https://github.com/NixOS/nix/blob/master/src/nix/flake.md
[flakes]: https://nixos.wiki/wiki/Flakes
[fu]: https://github.com/numtide/flake-utils
[fup]: https://github.com/gytis-ivaskevicius/flake-utils-plus
[giants]: https://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants
[home-manager]: https://nix-community.github.io/home-manager
[mit]: https://mit-license.org
[mk-flake]: https://github.com/divnix/digga/tree/master/src/mkFlake
[nix]: https://nixos.org/manual/nix/stable
[nixos]: https://nixos.org/manual/nixos/stable
[nixpkgs]: https://github.com/NixOS/nixpkgs
[nvfetcher]: https://github.com/berberman/nvfetcher
[please]: https://github.com/nrdxp/devos/tree/nrd [please]: https://github.com/nrdxp/devos/tree/nrd
[matrix]: https://matrix.to/#/#devos:nixos.org [toc]: https://github.com/divnix/devos/blob/core/flake.nix

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

@ -20,9 +20,52 @@
"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": 1626456025,
"narHash": "sha256-TrKfxVir+TilnqSNYokxJKx2ugEem7Khv4YmSwqj9JQ=",
"owner": "divnix",
"repo": "bud",
"rev": "59c10c3879b11371944ab664462fe2e9366cfb44",
"type": "github"
},
"original": {
"owner": "divnix",
"repo": "bud",
"type": "github"
}
},
"ci-agent": { "ci-agent": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": [
"digga",
"deploy",
"flake-compat"
],
"nix-darwin": [ "nix-darwin": [
"darwin" "darwin"
], ],
@ -70,17 +113,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": {
@ -91,11 +138,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": {
@ -106,23 +153,33 @@
}, },
"digga": { "digga": {
"inputs": { "inputs": {
"blank": "blank",
"deploy": "deploy", "deploy": "deploy",
"devshell": "devshell", "devshell": "devshell",
"nixlib": "nixlib", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2", "home-manager": [
"utils": "utils_2" "home"
],
"nixlib": [
"nixos"
],
"nixos-generators": "nixos-generators",
"nixpkgs": [
"nixos"
],
"utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1623197477, "lastModified": 1626470112,
"narHash": "sha256-2Qk/uIHb1nXre2rRlGonAJmpuamBs7RRfgXhMmS5JkU=", "narHash": "sha256-hC5I3A1HxfGi45avpYBf8zXi1hQkHYWgRgUM4sF9byI=",
"owner": "divnix", "owner": "divnix",
"repo": "digga", "repo": "digga",
"rev": "f69703abc33f221b676966a8435c4f09ef70ff49", "rev": "f25928ed0bf05ab20af5a8231d264ae01b42ab34",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "divnix", "owner": "divnix",
"ref": "master", "ref": "develop",
"repo": "digga", "repo": "digga",
"type": "github" "type": "github"
} }
@ -143,29 +200,13 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1606424373,
"narHash": "sha256-oq8d4//CJOrVj+EcOaSXvMebvuTkmBJuT5tzlfewUnQ=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "99f1c2157fba4bfe6211a321fd0ee43199025dbf",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"locked": { "locked": {
"lastModified": 1620759905, "lastModified": 1623875721,
"narHash": "sha256-WiyWawrgmyN0EdmiHyG2V+fqReiVi8bM9cRdMaKQOFg=", "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "b543720b25df6ffdfcf9227afafc5b8c1fabfae8", "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -196,26 +237,27 @@
] ]
}, },
"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": 1626192309, "lastModified": 1626529037,
"narHash": "sha256-uMl42Cn1Zb3qe8Iw0Rz7x62DUEG1JPCtJNU3ZK5gEFQ=", "narHash": "sha256-Q1vbk2fgE43JgjvTBdghZ70ParF2ek/jTn62ACkU8Fw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4036bb94c78329292ef44c233bb42da40b8bd4d2", "rev": "5f069e17541ac5cd240fced18687cef190080be3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -230,11 +272,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": {
@ -267,7 +309,7 @@
"nix-dram": { "nix-dram": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1620663773, "lastModified": 1620663773,
@ -283,36 +325,44 @@
"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": 1626046891, "lastModified": 1626527571,
"narHash": "sha256-Zt8saH+hAehXskW0iFAzk+iMillYoFBxvLReYNqGT9E=", "narHash": "sha256-+X2GhKfkuLUYs8wVQPUKZULX3OvaNn2KwrvhoxQk9SA=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d8f8f31af9d77a48220e4e8a301d1e79774cb7d2", "rev": "0a96dbc8b6bd4874ef0f55ce30ec7bdf1cb09452",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-unstable", "ref": "release-21.05",
"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,
@ -329,37 +379,6 @@
} }
}, },
"nixpkgs": { "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"
}
},
"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"
}
},
"nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1620340338, "lastModified": 1620340338,
"narHash": "sha256-Op/4K0+Z9Sp5jtFH0s/zMM4H7VFZxrekcAmjQ6JpQ4w=", "narHash": "sha256-Op/4K0+Z9Sp5jtFH0s/zMM4H7VFZxrekcAmjQ6JpQ4w=",
@ -377,10 +396,10 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1626188191, "lastModified": 1626202371,
"narHash": "sha256-63A/IjYpfKb/R+AiWZE6YHsaxkDnYIVSUgPw7QEQnA8=", "narHash": "sha256-thj8msabJEeAfuC/6Zb4jZnnJ7SfcLUZEY0TjXhFQNs=",
"path": "/nix/store/hjc7qr7xsbvx32092bpfsjyi6vk29fg4-source", "path": "/nix/store/z9h5jj2b9ls0q3mkvhdz5s05ly7m20k7-source",
"rev": "5caa4740529326001714f4c49a5e9f7b2c40f737", "rev": "c10216f94e7e99a05f515a8bdc87d5b460164f1a",
"type": "path" "type": "path"
}, },
"original": { "original": {
@ -388,20 +407,34 @@
"type": "indirect" "type": "indirect"
} }
}, },
"pkgs": { "nvfetcher": {
"inputs": { "inputs": {
"flake-compat": [
"digga",
"deploy",
"flake-compat"
],
"flake-utils": [
"digga",
"utils",
"flake-utils"
],
"nixpkgs": [ "nixpkgs": [
"nixos" "latest"
] ]
}, },
"locked": { "locked": {
"narHash": "sha256-G+qmA0vMRMgEd0Wp+jMjbOe5Yz+5/Imh+wn6mTWit1o=", "lastModified": 1626443440,
"path": "./pkgs", "narHash": "sha256-9xDWqVcLxAiRC/g/JnSfsj+s/Ont0fZjczAH9pqqBdg=",
"type": "path" "owner": "berberman",
"repo": "nvfetcher",
"rev": "ba3366421ff66a06f4176780dff5e8373512bfba",
"type": "github"
}, },
"original": { "original": {
"path": "./pkgs", "owner": "berberman",
"type": "path" "repo": "nvfetcher",
"type": "github"
} }
}, },
"pre-commit-hooks-nix": { "pre-commit-hooks-nix": {
@ -423,44 +456,55 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"blank": [
"digga",
"blank"
],
"bud": "bud",
"ci-agent": "ci-agent", "ci-agent": "ci-agent",
"darwin": "darwin", "darwin": "darwin",
"deploy": [
"digga",
"deploy"
],
"digga": "digga", "digga": "digga",
"flake-utils": [
"digga",
"flake-utils"
],
"home": "home", "home": "home",
"latest": "latest", "latest": "latest",
"naersk": "naersk_2", "naersk": "naersk_2",
"nix-dram": "nix-dram", "nix-dram": "nix-dram",
"nixlib": [
"digga",
"nixlib"
],
"nixos": "nixos", "nixos": "nixos",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": [
"nixos"
],
"nur": "nur", "nur": "nur",
"pkgs": "pkgs" "nvfetcher": "nvfetcher",
"utils": [
"digga",
"utils"
]
} }
}, },
"utils": { "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": { "inputs": {
"flake-utils": "flake-utils" "flake-utils": [
"flake-utils"
]
}, },
"locked": { "locked": {
"lastModified": 1622583383, "lastModified": 1626288344,
"narHash": "sha256-2DFx619SNfjzYwqx1ryae8zHnTh+N7VsZkbtAbrYIIA=", "narHash": "sha256-TioHDqWJkw37jjx4DVrH6LCzwrUfAqXbWl4rKR91fpA=",
"owner": "gytis-ivaskevicius", "owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus", "repo": "flake-utils-plus",
"rev": "6b2ea4b02cad77fac581c6a9ec4f822ba87dce5c", "rev": "5c6ee69f6957afc2fe22c094717d6d78516418b5",
"type": "github" "type": "github"
}, },
"original": { "original": {

211
flake.nix
View file

@ -1,130 +1,175 @@
{ {
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/release-21.05";
latest.url = "nixpkgs"; latest.url = "nixpkgs";
digga.url = "github:divnix/digga/master";
ci-agent = { digga.url = "github:divnix/digga/develop";
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/utils/flake-utils";
ci-agent.url = "github:hercules-ci/hercules-ci-agent";
ci-agent.inputs.nix-darwin.follows = "darwin";
ci-agent.inputs.nixos-20_09.follows = "nixos";
ci-agent.inputs.nixos-unstable.follows = "latest";
ci-agent.inputs.flake-compat.follows = "digga/deploy/flake-compat";
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"; # start ANTI CORRUPTION LAYER
pkgs.inputs.nixpkgs.follows = "nixos"; # remove after https://github.com/NixOS/nix/pull/4641
nixpkgs.follows = "nixos";
nixlib.follows = "digga/nixlib";
blank.follows = "digga/blank";
utils.follows = "digga/utils";
flake-utils.follows = "digga/flake-utils";
# end ANTI CORRUPTION LAYER
# PubSolarOS additions # PubSolarOS additions
nix-dram.url = "github:dramforever/nix-dram"; nix-dram.url = "github:dramforever/nix-dram";
}; };
outputs = outputs =
{ self { self
, pkgs
, digga , digga
, bud
, nixos , nixos
, ci-agent , ci-agent
, home , home
, nixos-hardware , nixos-hardware
, nur , nur
, agenix , agenix
, nvfetcher
, deploy
, nix-dram , nix-dram
, ... , ...
} @ inputs: } @ inputs:
digga.lib.mkFlake { let
inherit self inputs; bud' = bud self; # rebind to access self.budModules
in
digga.lib.mkFlake
{
inherit self inputs;
channelsConfig = { allowUnfree = true; }; channelsConfig = { allowUnfree = true; };
channels = {
nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ];
overlays = [
digga.overlays.patchedNix
nur.overlay
agenix.overlay
nvfetcher.overlay
deploy.overlay
nix-dram.overlay
./pkgs/default.nix
];
};
latest = { };
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
__dontExport = true;
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
channels = {
nixos = { nixos = {
imports = [ (digga.lib.importers.overlays ./overlays) ]; hostDefaults = {
overlays = [ system = "x86_64-linux";
./pkgs/default.nix channelName = "nixos";
pkgs.overlay # for `srcs` imports = [ (digga.lib.importers.modules ./modules) ];
nur.overlay externalModules = [
agenix.overlay { lib.our = self.lib; }
nix-dram.overlay digga.nixosModules.nixConfig
]; ci-agent.nixosModules.agent-profile
}; home.nixosModules.home-manager
latest = { }; agenix.nixosModules.age
}; (bud.nixosModules.bud bud')
];
lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [
(final: prev: {
lib = prev.lib.extend (lfinal: lprev: {
our = self.lib;
});
})
];
nixos = {
hostDefaults = {
system = "x86_64-linux";
channelName = "nixos";
modules = ./modules/module-list.nix;
externalModules = [
{ _module.args.ourLib = self.lib; }
ci-agent.nixosModules.agent-profile
home.nixosModules.home-manager
agenix.nixosModules.age
./modules/customBuilds.nix
];
};
imports = [ (digga.lib.importers.hosts ./hosts) ];
hosts = {
/* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./profiles // {
users = digga.lib.importers.rakeLeaves ./users;
}; };
suites = with profiles; rec {
base = [ core users.nixos users.root ]; imports = [ (digga.lib.importers.hosts ./hosts) ];
pubsolaros = [ core base-user users.root ]; hosts = {
anonymous = [ pubsolaros users.nixos ]; /* set host specific properties here */
NixOS = { };
};
importables = rec {
profiles = digga.lib.importers.rakeLeaves ./profiles // {
users = digga.lib.importers.rakeLeaves ./users;
};
suites = with profiles; rec {
base = [ core users.nixos users.root ];
pubsolaros = [ core base-user users.root ];
anonymous = [ pubsolaros users.nixos ];
};
}; };
}; };
};
home = { home = {
modules = ./users/modules/module-list.nix; imports = [ (digga.lib.importers.modules ./users/modules) ];
externalModules = [ ]; externalModules = [ ];
importables = rec { importables = rec {
profiles = digga.lib.importers.rakeLeaves ./users/profiles; profiles = digga.lib.importers.rakeLeaves ./users/profiles;
suites = with profiles; rec { suites = with profiles; rec {
base = [ direnv git ]; base = [ direnv git ];
};
}; };
users = {
nixos = { suites, ... }: { imports = suites.base; };
}; # digga.lib.importers.rakeLeaves ./users/hm;
}; };
};
devshell.externalModules = { pkgs, ... }: { devshell.modules = [ (import ./shell bud') ];
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 +1,11 @@
{ lib, self, diggaLib, config, modules, channel, ... }: { lib, pkgs, self, 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 = { system.build = {
iso = (mkBuild (diggaLib.modules.isoConfig { iso = (config.lib.digga.mkBuild
inherit self; (config.lib.digga.modules.isoConfig {
fullHostConfig = config; inherit self;
})).config.system.build.isoImage; fullHostConfig = config;
})
homes = (mkBuild ({ config, ... }: { ).config.system.build.isoImage;
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;
}
];
}

View file

@ -1,21 +0,0 @@
[
./compat
./user
./x-os
./sway
./graphical
./docker
./audio
./email
./crypto
./nextcloud
./gaming
./virtualisation
./social
./devops
./terminal-life
./server
./printing
./office
./uhk
]

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}"
];
}

View file

@ -125,7 +125,7 @@ output * bg ~/.config/wallpaper.jpg fill
bindsym $mod+Shift+9 move container to workspace 9; workspace $ws9 bindsym $mod+Shift+9 move container to workspace 9; workspace $ws9
# Note: workspaces can have any name you want, not just numbers. # Note: workspaces can have any name you want, not just numbers.
# We just use 1-10 as the default. # We just use 1-10 as the default.
#navigate workspaces next / previous #navigate workspaces next / previous
bindsym $mod+Ctrl+Right workspace next bindsym $mod+Ctrl+Right workspace next
bindsym $mod+Ctrl+Left workspace prev bindsym $mod+Ctrl+Left workspace prev
@ -141,13 +141,13 @@ output * bg ~/.config/wallpaper.jpg fill
# Configure border style <normal|1pixel|pixel xx|none|pixel> # Configure border style <normal|1pixel|pixel xx|none|pixel>
default_border pixel 1 default_border pixel 1
default_floating_border normal default_floating_border normal
# Hide borders # Hide borders
hide_edge_borders none hide_edge_borders none
# Font for window titles. Will also be used by the bar unless a different font # Font for window titles. Will also be used by the bar unless a different font
# is used in the bar {} block below. # is used in the bar {} block below.
font xft:Hack 16 font xft:Hack 16
# You can "split" the current object of your focus with # You can "split" the current object of your focus with
# $mod+b or $mod+v, for horizontal and vertical splits # $mod+b or $mod+v, for horizontal and vertical splits

View file

@ -10,7 +10,7 @@ gaps outer -5
# Smart gaps (gaps used if only more than one container on the workspace) # Smart gaps (gaps used if only more than one container on the workspace)
smart_gaps on smart_gaps on
# Smart borders (draw borders around container only if it is not the only container on this workspace) # Smart borders (draw borders around container only if it is not the only container on this workspace)
# on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0) # on|no_gaps (on=always activate and no_gaps=only activate if the gap size to the edge of the screen is 0)
smart_borders on smart_borders on

View file

@ -1,5 +1,5 @@
# Note that the systemctl commands must be run synchronously and can't be split into # Note that the systemctl commands must be run synchronously and can't be split into
# three exec statements, since otherwise the session target may be started before # three exec statements, since otherwise the session target may be started before
# systemctl import-environment is complete, and services that require certain variables # systemctl import-environment is complete, and services that require certain variables
# will fail to run. # will fail to run.
# https://github.com/swaywm/sway/wiki/Systemd-integration # https://github.com/swaywm/sway/wiki/Systemd-integration

View file

@ -596,7 +596,7 @@
typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172 typeset -g POWERLEVEL9K_ASDF_HASKELL_FOREGROUND=172
# typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐' # typeset -g POWERLEVEL9K_ASDF_HASKELL_VISUAL_IDENTIFIER_EXPANSION='⭐'
# typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar' # typeset -g POWERLEVEL9K_ASDF_HASKELL_SHOW_ON_UPGLOB='*.foo|*.bar'
###########[ nix_shell ]########### ###########[ nix_shell ]###########
# # Nix shell color. # # Nix shell color.
typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74 typeset -g POWERLEVEL9K_NIX_SHELL_FOREGROUND=74

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

@ -7,7 +7,6 @@ channels: final: prev: {
dhall dhall
discord discord
element-desktop element-desktop
manix
rage rage
neovim-unwrapped neovim-unwrapped
nixpkgs-fmt nixpkgs-fmt
@ -16,15 +15,15 @@ channels: final: prev: {
starship; starship;
haskellPackages = prev.haskellPackages.override { haskellPackages = prev.haskellPackages.override
overrides = hfinal: hprev: (old: {
let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version; overrides = prev.lib.composeExtensions (old.overrides or (_: _: { })) (hfinal: hprev:
in let version = prev.lib.replaceChars [ "." ] [ "" ] prev.ghc.version;
{ in
# same for haskell packages, matching ghc versions {
inherit (channels.latest.haskell.packages."ghc${version}") # same for haskell packages, matching ghc versions
haskell-language-server; inherit (channels.latest.haskell.packages."ghc${version}")
}; haskell-language-server;
}; });
});
} }

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,15 +1,18 @@
final: prev: final: prev:
with final; { with final; {
import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final); # keep sources this first
mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final); sources = prev.callPackage (import ./_sources/generated.nix) { };
mopidy-jellyfin = import ./mopidy-jellyfin.nix final; # then, call packages with `final.callPackage`
mu = writeShellScriptBin "mu" (import ./mu.nix final); import-gtk-settings = writeShellScriptBin "import-gtk-settings" (import ./import-gtk-settings.nix final);
psos = writeShellScriptBin "psos" (import ./psos.nix final); mailto-mutt = writeShellScriptBin "mailto-mutt" (import ./mailto-mutt.nix final);
s = writeShellScriptBin "s" (import ./s.nix final); mopidy-jellyfin = import ./mopidy-jellyfin.nix final;
sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final); mu = writeShellScriptBin "mu" (import ./mu.nix final);
sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final); psos = writeShellScriptBin "psos" (import ./psos.nix final);
swaylock-bg = writeScriptBin "swaylock-bg" (import ./swaylock-bg.nix final); s = writeShellScriptBin "s" (import ./s.nix final);
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final); sway-launcher = writeScriptBin "sway-launcher" (import ./sway-launcher.nix final);
uhk-agent = import ./uhk-agent.nix final; sway-service = writeShellScriptBin "sway-service" (import ./sway-service.nix final);
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final); swaylock-bg = writeScriptBin "swaylock-bg" (import ./swaylock-bg.nix final);
toggle-kbd-layout = writeShellScriptBin "toggle-kbd-layout" (import ./toggle-kbd-layout.nix final);
uhk-agent = import ./uhk-agent.nix final;
wcwd = writeShellScriptBin "wcwd" (import ./wcwd.nix final);
} }

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

@ -116,7 +116,7 @@ EXEC 01;32
#.sh 01;32 #.sh 01;32
#.csh 01;32 #.csh 01;32
# archives or compressed (bright red) # archives or compressed (bright red)
.tar 01;31 .tar 01;31
.tgz 01;31 .tgz 01;31
.arc 01;31 .arc 01;31

View file

@ -1 +1 @@
text/html; w3m -I %{charset} -T text/html; copiousoutput; text/html; w3m -I %{charset} -T text/html; copiousoutput;

View file

@ -4,7 +4,7 @@
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported. # absolute path. No other format is supported.
#
XDG_DESKTOP_DIR="$HOME/" XDG_DESKTOP_DIR="$HOME/"
XDG_DOWNLOAD_DIR="$HOME/Downloads" XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates" XDG_TEMPLATES_DIR="$HOME/Templates"

View file

@ -1 +1 @@
en_US en_US

View file

@ -195,26 +195,26 @@ filextype *.djvu
" Audio " Audio
filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus filetype *.wav,*.mp3,*.flac,*.m4a,*.wma,*.ape,*.ac3,*.og[agx],*.spx,*.opus
\ {Play using vlc} \ {Play using vlc}
\ vlc %c, \ vlc %c,
\ {Play using ffplay} \ {Play using ffplay}
\ ffplay -nodisp -autoexit %c, \ ffplay -nodisp -autoexit %c,
fileviewer *.mp3 mp3info fileviewer *.mp3 mp3info
fileviewer *.flac soxi fileviewer *.flac soxi
" Video " Video
filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, filextype *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\*.as[fx] \*.as[fx]
\ {View using vlc} \ {View using vlc}
\ vlc %f, \ vlc %f,
\ {View using ffplay} \ {View using ffplay}
\ ffplay -fs -autoexit %f, \ ffplay -fs -autoexit %f,
fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob, fileviewer *.avi,*.mp4,*.wmv,*.dat,*.3gp,*.ogv,*.mkv,*.mpg,*.mpeg,*.vob,
\*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx, \*.fl[icv],*.m2v,*.mov,*.webm,*.ts,*.mts,*.m4v,*.r[am],*.qt,*.divx,
\*.as[fx] \*.as[fx]
\ vifmimg videopreview %px %py %pw %ph %c \ vifmimg videopreview %px %py %pw %ph %c
\ %pc \ %pc
\ vifmimg clear \ vifmimg clear
" \ ffprobe -pretty %c 2>&1 " \ ffprobe -pretty %c 2>&1
@ -242,7 +242,7 @@ fileviewer *.bmp,*.jpg,*.jpeg,*.png,*.xpm
\ %pc \ %pc
\ vifmimg clear \ vifmimg clear
" Get w3m image previews inside vifm " Get w3m image previews inside vifm
" \ imgt %px %py %pw %ph %c " \ imgt %px %py %pw %ph %c
" \ %pc " \ %pc
" \ imgc %px %py %pw %ph NOT NEEDED IN XTERM " \ imgc %px %py %pw %ph NOT NEEDED IN XTERM
fileviewer *.gif fileviewer *.gif
@ -262,28 +262,28 @@ filextype *.vym
" MD5 " MD5
filetype *.md5 filetype *.md5
\ {Check MD5 hash sum} \ {Check MD5 hash sum}
\ md5sum -c %f %S, \ md5sum -c %f %S,
" SHA1 " SHA1
filetype *.sha1 filetype *.sha1
\ {Check SHA1 hash sum} \ {Check SHA1 hash sum}
\ sha1sum -c %f %S, \ sha1sum -c %f %S,
" SHA256 " SHA256
filetype *.sha256 filetype *.sha256
\ {Check SHA256 hash sum} \ {Check SHA256 hash sum}
\ sha256sum -c %f %S, \ sha256sum -c %f %S,
" SHA512 " SHA512
filetype *.sha512 filetype *.sha512
\ {Check SHA512 hash sum} \ {Check SHA512 hash sum}
\ sha512sum -c %f %S, \ sha512sum -c %f %S,
" GPG signature " GPG signature
filetype *.asc filetype *.asc
\ {Check signature} \ {Check signature}
\ !!gpg --verify %c, \ !!gpg --verify %c,
" Torrent " Torrent
filetype *.torrent ktorrent %f & filetype *.torrent ktorrent %f &
@ -291,18 +291,18 @@ fileviewer *.torrent dumptorrent -v %c
" FuseZipMount " FuseZipMount
filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg filetype *.zip,*.jar,*.war,*.ear,*.oxt,*.apkg
\ {Mount with fuse-zip} \ {Mount with fuse-zip}
\ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR, \ FUSE_MOUNT|fuse-zip %SOURCE_FILE %DESTINATION_DIR,
\ {View contents} \ {View contents}
\ zip -sf %c | less, \ zip -sf %c | less,
\ {Extract here} \ {Extract here}
\ tar -xf %c, \ tar -xf %c,
fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c fileviewer *.zip,*.jar,*.war,*.ear,*.oxt zip -sf %c
" ArchiveMount " ArchiveMount
filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz filetype *.tar,*.tar.bz2,*.tbz2,*.tgz,*.tar.gz,*.tar.xz,*.txz
\ {Mount with archivemount} \ {Mount with archivemount}
\ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR, \ FUSE_MOUNT|archivemount %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.tgz,*.tar.gz tar -tzf %c fileviewer *.tgz,*.tar.gz tar -tzf %c
fileviewer *.tar.bz2,*.tbz2 tar -tjf %c fileviewer *.tar.bz2,*.tbz2 tar -tjf %c
fileviewer *.tar.txz,*.txz xz --list %c fileviewer *.tar.txz,*.txz xz --list %c
@ -310,29 +310,29 @@ fileviewer *.tar tar -tf %c
" Rar2FsMount and rar archives " Rar2FsMount and rar archives
filetype *.rar filetype *.rar
\ {Mount with rar2fs} \ {Mount with rar2fs}
\ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR, \ FUSE_MOUNT|rar2fs %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.rar unrar v %c fileviewer *.rar unrar v %c
" IsoMount " IsoMount
filetype *.iso filetype *.iso
\ {Mount with fuseiso} \ {Mount with fuseiso}
\ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR, \ FUSE_MOUNT|fuseiso %SOURCE_FILE %DESTINATION_DIR,
" SshMount " SshMount
filetype *.ssh filetype *.ssh
\ {Mount with sshfs} \ {Mount with sshfs}
\ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND, \ FUSE_MOUNT2|sshfs %PARAM %DESTINATION_DIR %FOREGROUND,
" FtpMount " FtpMount
filetype *.ftp filetype *.ftp
\ {Mount with curlftpfs} \ {Mount with curlftpfs}
\ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND, \ FUSE_MOUNT2|curlftpfs -o ftp_port=-,,disable_eprt %PARAM %DESTINATION_DIR %FOREGROUND,
" Fuse7z and 7z archives " Fuse7z and 7z archives
filetype *.7z filetype *.7z
\ {Mount with fuse-7z} \ {Mount with fuse-7z}
\ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR, \ FUSE_MOUNT|fuse-7z %SOURCE_FILE %DESTINATION_DIR,
fileviewer *.7z 7z l %c fileviewer *.7z 7z l %c
" Office files " Office files
@ -348,8 +348,8 @@ filextype *.pro qtcreator %f &
" All others " All others
filetype *.ts,*.js,*.css,*.sass,*.scss,*.go,*.rs,*.py,*.html,*.xhtml,*.json,*.jsx,*.tsx,*.vue,*.svelte,*.sql filetype *.ts,*.js,*.css,*.sass,*.scss,*.go,*.rs,*.py,*.html,*.xhtml,*.json,*.jsx,*.tsx,*.vue,*.svelte,*.sql
\ {Open in editor} \ {Open in editor}
\ nvim %c, \ nvim %c,
fileviewer *.ts,*.js,*.css,*.sass,*.scss,*.go,*.rs,*.py,*.html,*.xhtml,*.json,*.jsx,*.tsx,*.vue,*.svelte,*.sql bat %c fileviewer *.ts,*.js,*.css,*.sass,*.scss,*.go,*.rs,*.py,*.html,*.xhtml,*.json,*.jsx,*.tsx,*.vue,*.svelte,*.sql bat %c
" Directories " Directories

View file

@ -1,102 +1,102 @@
{ {
"layer": "top", // Waybar at top layer "layer": "top", // Waybar at top layer
// "position": "bottom", // Waybar position (top|bottom|left|right) // "position": "bottom", // Waybar position (top|bottom|left|right)
"height": 26, // Waybar height "height": 26, // Waybar height
"modules-left": ["sway/workspaces", "sway/mode"], "modules-left": ["sway/workspaces", "sway/mode"],
"modules-center": ["mpd"], "modules-center": ["mpd"],
"modules-right": ["sway/language", "pulseaudio", "network", "idle_inhibitor", "battery", "clock", "tray"], "modules-right": ["sway/language", "pulseaudio", "network", "idle_inhibitor", "battery", "clock", "tray"],
"sway/workspaces": { "sway/workspaces": {
"disable-scroll": true "disable-scroll": true
}, },
"sway/mode": { "sway/mode": {
"tooltip": false, "tooltip": false,
"format": "{}" "format": "{}"
}, },
"sway/window": { "sway/window": {
"tooltip": false, "tooltip": false,
"max-length": 96 "max-length": 96
}, },
"sway/language": { "sway/language": {
"format": "{}", "format": "{}",
"max-length": 50 "max-length": 50
}, },
"tray": { "tray": {
"icon-size": 21, "icon-size": 21,
"spacing": 10 "spacing": 10
}, },
"clock": { "clock": {
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format-alt": "{:%a %d. %h %H:%M}" "format-alt": "{:%a %d. %h %H:%M}"
}, },
"backlight": { "backlight": {
// "device": "acpi_video1", // "device": "acpi_video1",
"tooltip": true, "tooltip": true,
"tooltip-format": "Brightness: <big>{percent}%</big>", "tooltip-format": "Brightness: <big>{percent}%</big>",
"format": "<span font='10'>{icon}</span>", "format": "<span font='10'>{icon}</span>",
"format-icons": ["", ""] "format-icons": ["", ""]
},
"cpu": {
"format": "{}% "
},
"memory": {
"format": "{}% "
},
"idle_inhibitor": {
"format": "<span font='10'>{icon} </span>",
"format-icons": {
"activated": "",
"deactivated": ""
}
},
"battery": {
"tooltip": false,
"states": {
"critical": 25
}, },
"cpu": { "full-at": 84,
"format": "{}% " "format": "<span font='10'>{icon}</span> {capacity}%",
}, "format-full": "<span font='10'>{icon}</span>",
"memory": { "format-icons": ["", "", "", "", ""],
"format": "{}% " },
}, "network": {
"idle_inhibitor": { "interval": 3,
"format": "<span font='10'>{icon} </span>", "tooltip": true,
"format-icons": { //"interface": "wlp4s0", // (Optional) To force the use of this interface   \uF2E7,
"activated": "", "format-wifi": "<span font='10'></span> \uf062 {bandwidthUpBits} | \uf063 {bandwidthDownBits}",
"deactivated": "" "format-ethernet": "<span font='10'></span> \uf062 {bandwidthUpBits} | \uf063 {bandwidthDownBits}",
} "format-disconnected": "",
"tooltip-format-wifi": "{essid} ({signalStrength}%)  {ipaddr}",
"tooltip-format-ethernet": "{ifname}  {ipaddr}"
},
//\ue04f{volume}%
"pulseaudio": {
"tooltip": false,
"format": "{volume}% <span font='10'>{icon}</span>",
"format-bluetooth": "{volume}% <span font='10'>{icon}</span>",
"format-muted": "",
"on-click": "pavucontrol",
"format-alt": "{volume}% <span font='10'>{icon}</span>",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["","", ""]
}
},
"mpd": {
"format": "{artist} - {title} <span color=\"#999999\">[<span color=\"#ffffff\">{elapsedTime:%M:%S}</span> / {totalTime:%M:%S}]</span>",
"format-disconnected": "",
"format-stopped": "",
"interval": 1,
"state-icons": {
"paused": "",
"playing": ""
}, },
"battery": { "tooltip-format": "MPD (connected)",
"tooltip": false, "tooltip-format-disconnected": "MPD (disconnected)"
"states": { }
"critical": 25
},
"full-at": 84,
"format": "<span font='10'>{icon}</span> {capacity}%",
"format-full": "<span font='10'>{icon}</span>",
"format-icons": ["", "", "", "", ""],
},
"network": {
"interval": 3,
"tooltip": true,
//"interface": "wlp4s0", // (Optional) To force the use of this interface   \uF2E7,
"format-wifi": "<span font='10'></span> \uf062 {bandwidthUpBits} | \uf063 {bandwidthDownBits}",
"format-ethernet": "<span font='10'></span> \uf062 {bandwidthUpBits} | \uf063 {bandwidthDownBits}",
"format-disconnected": "",
"tooltip-format-wifi": "{essid} ({signalStrength}%)  {ipaddr}",
"tooltip-format-ethernet": "{ifname}  {ipaddr}"
},
//\ue04f{volume}%
"pulseaudio": {
"tooltip": false,
"format": "{volume}% <span font='10'>{icon}</span>",
"format-bluetooth": "{volume}% <span font='10'>{icon}</span>",
"format-muted": "",
"on-click": "pavucontrol",
"format-alt": "{volume}% <span font='10'>{icon}</span>",
"format-icons": {
"headphones": "",
"handsfree": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["","", ""]
}
},
"mpd": {
"format": "{artist} - {title} <span color=\"#999999\">[<span color=\"#ffffff\">{elapsedTime:%M:%S}</span> / {totalTime:%M:%S}]</span>",
"format-disconnected": "",
"format-stopped": "",
"interval": 1,
"state-icons": {
"paused": "",
"playing": ""
},
"tooltip-format": "MPD (connected)",
"tooltip-format-disconnected": "MPD (disconnected)"
}
} }

View file

@ -51,7 +51,7 @@ window#waybar {
} }
#battery.critical { #battery.critical {
color: @base07; color: @base07;
} }
#battery.charging { #battery.charging {
color: @base0B; color: @base0B;

View file

@ -46,28 +46,28 @@ if [ -d /etc/X11/xinit/xinitrc.d ] ; then
fi fi
get_session(){ get_session(){
local dbus_args=(--sh-syntax --exit-with-session) local dbus_args=(--sh-syntax --exit-with-session)
case $1 in case $1 in
awesome) dbus_args+=(awesome) ;; awesome) dbus_args+=(awesome) ;;
bspwm) dbus_args+=(bspwm-session) ;; bspwm) dbus_args+=(bspwm-session) ;;
budgie) dbus_args+=(budgie-desktop) ;; budgie) dbus_args+=(budgie-desktop) ;;
cinnamon) dbus_args+=(cinnamon-session) ;; cinnamon) dbus_args+=(cinnamon-session) ;;
deepin) dbus_args+=(startdde) ;; deepin) dbus_args+=(startdde) ;;
enlightenment) dbus_args+=(enlightenment_start) ;; enlightenment) dbus_args+=(enlightenment_start) ;;
fluxbox) dbus_args+=(startfluxbox) ;; fluxbox) dbus_args+=(startfluxbox) ;;
gnome) dbus_args+=(gnome-session) ;; gnome) dbus_args+=(gnome-session) ;;
i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;; i3|i3wm) dbus_args+=(i3 --shmlog-size 0) ;;
jwm) dbus_args+=(jwm) ;; jwm) dbus_args+=(jwm) ;;
kde) dbus_args+=(startkde) ;; kde) dbus_args+=(startkde) ;;
lxde) dbus_args+=(startlxde) ;; lxde) dbus_args+=(startlxde) ;;
lxqt) dbus_args+=(lxqt-session) ;; lxqt) dbus_args+=(lxqt-session) ;;
mate) dbus_args+=(mate-session) ;; mate) dbus_args+=(mate-session) ;;
xfce) dbus_args+=(xfce4-session) ;; xfce) dbus_args+=(xfce4-session) ;;
openbox) dbus_args+=(openbox-session) ;; openbox) dbus_args+=(openbox-session) ;;
*) dbus_args+=($DEFAULT_SESSION) ;; *) dbus_args+=($DEFAULT_SESSION) ;;
esac esac
echo "dbus-launch ${dbus_args[*]}" echo "dbus-launch ${dbus_args[*]}"
} }
exec $(get_session) exec $(get_session)

63
shell/default.nix Normal file
View file

@ -0,0 +1,63 @@
bud:
{ 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 (bud { inherit 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;

View file

@ -1,6 +1,6 @@
{ {
programs.direnv = { programs.direnv = {
enable = true; enable = true;
enableNixDirenvIntegration = true; nix-direnv.enable = true;
}; };
} }