2021-09-24 06:09:20 +02:00
{
description = " m y k r o p s f i l e " ;
inputs = {
2021-09-25 11:07:09 +02:00
secrets = {
2022-01-15 09:32:59 +01:00
url = " g i t + s s h : / / g i t e a @ g i t . i n g o l f - w a g n e r . d e / p a l o / n i x o s - s e c r e t s . g i t ? r e f = m a i n " ;
2021-09-25 11:07:09 +02:00
flake = false ;
} ;
2022-12-20 17:11:43 +01:00
nixpkgs . url = " g i t h u b : n i x o s / n i x p k g s / n i x o s - 2 2 . 1 1 " ;
2023-01-23 20:04:50 +01:00
nixos-hardware = {
url = " g i t h u b : n i x o s / n i x o s - h a r d w a r e " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2022-06-22 21:54:57 +02:00
# colmena
2022-06-22 23:06:16 +02:00
# -------
2022-09-23 20:29:18 +02:00
colmena = {
url = " g i t h u b : z h a o f e n g l i / c o l m e n a " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2022-06-22 21:54:57 +02:00
nixpkgs-unstable . url = " g i t h u b : n i x o s / n i x p k g s / n i x o s - u n s t a b l e " ;
2023-01-16 11:21:15 +01:00
nixpkgs-legacy . url = " g i t h u b : n i x o s / n i x p k g s / n i x o s - 2 2 . 0 5 " ;
2022-06-22 21:54:57 +02:00
polygon-art = {
url = " g i t + h t t p s : / / g i t . i n g o l f - w a g n e r . d e / p a l o / p o l y g o n - a r t . g i t " ;
} ;
sops-nix . url = " g i t h u b : M i c 9 2 / s o p s - n i x " ;
emacs-overlay = {
url = " g i t h u b : n i x - c o m m u n i t y / e m a c s - o v e r l a y " ;
flake = false ;
} ;
doom-emacs-nix = {
url = " g i t h u b : n i x - c o m m u n i t y / n i x - d o o m - e m a c s " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
#inputs.emacs-overlay.follows = "emacs-overlay";
} ;
home-manager = {
2022-12-20 17:11:43 +01:00
url = " g i t h u b : n i x - c o m m u n i t y / h o m e - m a n a g e r / r e l e a s e - 2 2 . 1 1 " ;
2022-06-22 21:54:57 +02:00
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
home-manager-utils = {
url = " g i t h u b : m r v a n d a l o / h o m e - m a n a g e r - u t i l s " ;
inputs . home-manager . follows = " h o m e - m a n a g e r " ;
} ;
nixpkgs-fmt = {
url = " g i t h u b : n i x - c o m m u n i t y / n i x p k g s - f m t " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
grocy-scanner = {
url = " g i t h u b : m r V a n D a l o / g r o c y - s c a n n e r " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2022-12-18 16:46:20 +01:00
permown = {
2022-12-18 17:29:16 +01:00
url = " g i t h u b : m r V a n D a l o / m o d u l e . p e r m o w n " ;
2022-12-18 16:46:20 +01:00
#url = "git+file:///home/palo/dev/nixos/permown";
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2022-06-22 23:06:16 +02:00
private_assets = {
2023-04-19 07:31:34 +02:00
url = " g i t + f i l e : / / / h o m e / p a l o / d e v / n i x o s / n i x o s - p r i v a t e - a s s e t s " ;
#url = "git+ssh://gitea@git.ingolf-wagner.de/palo/nixos-private-assets.git?ref=main";
2023-03-07 16:21:46 +01:00
flake = true ;
2022-06-22 23:06:16 +02:00
} ;
2022-09-29 12:36:36 +02:00
retiolum = {
2023-02-16 21:43:28 +01:00
url = " g i t h u b : M i c 9 2 / r e t i o l u m " ;
#url = "git+file:///home/palo/dev/nixos/retiolum";
2022-09-29 12:36:36 +02:00
} ;
2022-11-24 13:48:18 +01:00
landingpage = {
#url = "git+file:///home/palo/dev/landingpage";
url = " g i t h u b : m r V a n D a l o / l a n d i n g p a g e " ;
2022-10-22 15:01:11 +02:00
} ;
2023-02-17 11:45:09 +01:00
kmonad = {
url = " g i t h u b : k m o n a d / k m o n a d ? d i r = n i x " ;
inputs . nixpkgs . follows = " n i x p k g s " ;
} ;
2021-09-24 06:09:20 +02:00
} ;
2022-06-22 21:54:57 +02:00
outputs =
{ self
, colmena
, doom-emacs-nix
, emacs-overlay
, grocy-scanner
, home-manager
, home-manager-utils
2023-01-23 20:04:50 +01:00
, nixos-hardware
2022-06-22 21:54:57 +02:00
, nixpkgs
, nixpkgs-fmt
2023-01-16 11:21:15 +01:00
, nixpkgs-legacy
2023-01-23 20:04:50 +01:00
, nixpkgs-unstable
, permown
2022-06-22 21:54:57 +02:00
, polygon-art
2022-06-22 23:06:16 +02:00
, private_assets
2022-06-22 21:54:57 +02:00
, secrets
2022-06-22 23:06:16 +02:00
, sops-nix
2022-09-29 12:36:36 +02:00
, retiolum
2022-11-24 13:48:18 +01:00
, landingpage
2023-02-17 11:45:09 +01:00
, kmonad
2022-06-22 21:54:57 +02:00
} :
2021-09-25 20:28:25 +02:00
let
system = " x 8 6 _ 6 4 - l i n u x " ;
pkgs = nixpkgs . legacyPackages . ${ system } ;
2022-06-23 00:33:59 +02:00
pullNetworkPasswords = pkgs . writers . writeBashBin " p u l l - n e t w o r k - p a s s w o r d s " ''
2022-06-23 01:03:37 +02:00
# collect all network configurations and save them in the store
sudo ls /etc/NetworkManager/system-connections \
| while read file
do
sudo cat " / e t c / N e t w o r k M a n a g e r / s y s t e m - c o n n e c t i o n s / $ f i l e " \
| $ { pkgs . pass } /bin/pass insert - m " k r o p s / d e s k t o p _ s e c r e t s / n e t w o r k - m a n a g e r / s y s t e m - c o n n e c t i o n s / $ f i l e "
done
2022-06-23 00:33:59 +02:00
'' ;
pushNetworkPasswords = pkgs . writers . writeBashBin " p u s h - n e t w o r k - p a s s w o r d s " ''
echo " p u s h n e t w o r k p a s s w o r d s t o $ 1 "
'' ;
2021-11-01 09:20:42 +01:00
in
{
2022-06-22 21:54:57 +02:00
# colmena
2022-06-23 00:33:59 +02:00
devShell . ${ system } =
2022-06-22 21:54:57 +02:00
pkgs . mkShell {
2022-06-23 00:33:59 +02:00
buildInputs = [
colmena . packages . ${ system } . colmena
pushNetworkPasswords
pullNetworkPasswords
nixpkgs-fmt . defaultPackage . ${ system }
] ;
2022-06-22 21:54:57 +02:00
} ;
2022-06-23 00:33:59 +02:00
colmena =
let
sopsModule = name : { lib , . . . }: {
sops . defaultSopsFile = lib . mkForce " ${ secrets } / s e c r e t s / ${ name } . y a m l " ;
imports = [
sops-nix . nixosModules . sops
2022-06-22 21:54:57 +02:00
] ;
} ;
2022-06-23 00:33:59 +02:00
in
{
meta = {
nixpkgs = import nixpkgs {
system = " x 8 6 _ 6 4 - l i n u x " ;
overlays = [
( _self : _super : {
# we assign the overlay created before to the overlays of nixpkgs.
unstable = nixpkgs-unstable . legacyPackages . ${ pkgs . system } ;
2023-01-16 11:21:15 +01:00
legacy = nixpkgs-legacy . legacyPackages . ${ pkgs . system } ;
2022-06-23 00:33:59 +02:00
polygon-art = polygon-art . packages . ${ pkgs . system } ;
2022-11-24 13:48:18 +01:00
landingpage = landingpage . packages . ${ pkgs . system } . plain ;
2022-06-23 00:33:59 +02:00
} )
] ;
} ;
specialArgs = {
2023-01-31 15:28:24 +01:00
inherit private_assets ;
2023-03-18 08:16:25 +01:00
assets = ./nixos/assets ;
2022-06-23 00:33:59 +02:00
} ;
2022-06-22 23:06:16 +02:00
} ;
2022-06-22 21:54:57 +02:00
2023-01-18 11:10:21 +01:00
defaults = { name , pkgs , lib , . . . }: {
deployment . buildOnTarget = lib . mkDefault true ;
2022-06-23 00:33:59 +02:00
nix = {
# no channesl needed this way
nixPath = [ " n i x p k g s = ${ pkgs . path } " ] ;
# make flakes available
package = pkgs . nixUnstable ;
extraOptions = ''
experimental-features = nix-command flakes
'' ;
2023-02-06 12:16:45 +01:00
settings = {
substituters = [ " h t t p s : / / c o l m e n a . c a c h i x . o r g " ] ;
trusted-public-keys = [ " c o l m e n a . c a c h i x . o r g - 1 : 7 B z p D n j j H 8 k i 2 C T 3 f 6 G d O k 7 Q A z P O l + 1 t 3 L v T L X q Y c S g = " ] ;
} ;
2022-06-22 21:54:57 +02:00
} ;
2022-06-23 00:33:59 +02:00
environment . systemPackages = [
2022-06-26 12:54:13 +02:00
nixpkgs-fmt . defaultPackage . ${ system }
colmena . packages . ${ system } . colmena
2022-06-23 00:33:59 +02:00
] ;
2023-02-06 14:02:45 +01:00
boot . tmpOnTmpfs = lib . mkDefault true ; # make /tmp a tmpfs (performance!)
2022-06-23 00:33:59 +02:00
imports = [
2022-09-20 21:48:36 +02:00
./nixos/machines / $ { name } /configuration.nix
2022-06-23 00:33:59 +02:00
( sopsModule name )
home-manager . nixosModules . home-manager
2022-12-18 16:46:20 +01:00
permown . nixosModules . permown
2022-06-23 00:33:59 +02:00
] ;
home-manager . useGlobalPkgs = true ;
home-manager . useUserPackages = true ;
2022-06-22 21:54:57 +02:00
} ;
2023-02-13 18:40:56 +01:00
cream = { name , nodes , pkgs , . . . }: {
deployment . allowLocalDeployment = true ;
deployment . targetHost = " ${ name } . p r i v a t e " ;
deployment . tags = [ " d e s k t o p " " o n l i n e " " p r i v a t e " ] ;
imports = [
grocy-scanner . nixosModule
nixos-hardware . nixosModules . framework-12th-gen-intel
#retiolum.nixosModules.retiolum
2023-02-17 11:45:09 +01:00
#kmonad.nixosModules.default
2023-03-07 16:21:46 +01:00
private_assets . nixosModules . jobrad
2023-02-13 18:40:56 +01:00
] ;
2023-02-17 11:45:09 +01:00
# todo : check out => https://github.com/terlar/nix-config/blob/ad35fbfc20e58626eb9fbd5f67716bc07bb98fc9/home-manager/modules/profiles/user/terje/keyboards.nix
#services.kmonad = {
# enable = false;
# keyboards.laptop-keyboard = {
# name = "laptop-keyboard";
# device = "";
# };
#};
2023-02-13 18:40:56 +01:00
home-manager . users . mainUser = {
imports = [
doom-emacs-nix . hmModule
home-manager-utils . hmModule
] ;
} ;
} ;
2022-06-23 00:33:59 +02:00
sterni = { name , nodes , pkgs , . . . }: {
2022-09-20 20:08:53 +02:00
deployment . allowLocalDeployment = true ;
2022-06-23 00:33:59 +02:00
deployment . targetHost = " ${ name } . p r i v a t e " ;
2022-09-23 20:29:18 +02:00
deployment . tags = [ " d e s k t o p " " o n l i n e " " p r i v a t e " ] ;
2022-06-23 00:33:59 +02:00
imports = [
grocy-scanner . nixosModule
2023-01-23 20:04:50 +01:00
nixos-hardware . nixosModules . lenovo-thinkpad-x220
2023-01-31 15:28:24 +01:00
retiolum . nixosModules . retiolum
2022-06-23 00:33:59 +02:00
] ;
2023-01-31 15:28:24 +01:00
2022-06-23 00:33:59 +02:00
home-manager . users . mainUser = {
imports = [
doom-emacs-nix . hmModule
home-manager-utils . hmModule
] ;
} ;
2022-06-22 21:54:57 +02:00
} ;
2022-06-23 00:33:59 +02:00
2022-06-23 08:39:18 +02:00
sternchen = { name , nodes , pkgs , . . . }: {
deployment . targetHost = " ${ name } . s e c r e t " ;
deployment . tags = [ " d e s k t o p " ] ;
imports = [
grocy-scanner . nixosModule
] ;
home-manager . users . mainUser = {
imports = [
doom-emacs-nix . hmModule
home-manager-utils . hmModule
] ;
2022-06-23 09:51:30 +02:00
programs . doom-emacs . enable = false ;
2022-06-23 08:39:18 +02:00
} ;
} ;
2022-06-23 00:33:59 +02:00
pepe = { name , nodes , pkgs , . . . }: {
deployment . targetHost = " ${ name } . p r i v a t e " ;
2022-09-23 20:29:18 +02:00
deployment . tags = [ " s e r v e r " " o n l i n e " " p r i v a t e " ] ;
2022-06-22 21:54:57 +02:00
imports = [
2022-06-23 00:33:59 +02:00
grocy-scanner . nixosModule
2023-01-23 20:04:50 +01:00
nixos-hardware . nixosModules . lenovo-thinkpad-x220
2022-06-22 21:54:57 +02:00
] ;
} ;
2022-06-23 00:53:29 +02:00
robi = { name , nodes , pkgs , . . . }: {
2022-10-19 13:16:24 +02:00
deployment . targetHost = " ${ name } . p r i v a t e " ;
2022-09-23 20:29:18 +02:00
deployment . tags = [ " s e r v e r " " o n l i n e " " p r i v a t e " ] ;
2022-12-18 16:46:20 +01:00
imports = [
2023-01-23 20:04:50 +01:00
nixos-hardware . nixosModules . common-cpu-intel
nixos-hardware . nixosModules . common-gpu-intel
2022-12-18 16:46:20 +01:00
] ;
2023-03-13 09:47:33 +01:00
home-manager . users . root = {
2023-03-18 08:16:25 +01:00
home . stateVersion = " 2 2 . 1 1 " ;
2023-03-13 09:47:33 +01:00
imports = [
doom-emacs-nix . hmModule
] ;
programs . doom-emacs = {
enable = true ;
emacsPackage = pkgs . emacs-nox ;
doomPrivateDir = ./doom.d ;
} ;
} ;
2022-06-23 00:53:29 +02:00
} ;
2022-10-19 13:16:24 +02:00
bobi = { name , nodes , pkgs , . . . }: {
2023-01-18 11:10:21 +01:00
deployment . targetHost = " ${ name } . p r i v a t e " ;
deployment . buildOnTarget = false ;
2022-10-19 13:16:24 +02:00
deployment . tags = [ " d e s k t o p " " u s b " " p r i v a t e " ] ;
imports = [
grocy-scanner . nixosModule
] ;
home-manager . users . mainUser = {
imports = [
doom-emacs-nix . hmModule
home-manager-utils . hmModule
] ;
} ;
} ;
2022-09-23 20:29:18 +02:00
mobi = { name , nodes , pkgs , . . . }: {
deployment . targetHost = " ${ name } . p r i v a t e " ;
2023-01-18 11:10:21 +01:00
deployment . buildOnTarget = false ;
2022-09-23 20:29:18 +02:00
deployment . tags = [ " d e s k t o p " " u s b " " p r i v a t e " ] ;
imports = [
grocy-scanner . nixosModule
] ;
home-manager . users . mainUser = {
imports = [
doom-emacs-nix . hmModule
home-manager-utils . hmModule
] ;
} ;
} ;
2022-06-22 21:54:57 +02:00
} ;
2021-09-25 20:28:25 +02:00
} ;
2021-09-24 06:09:20 +02:00
}
2022-06-22 21:54:57 +02:00