This repository has been archived on 2024-07-08. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config-tn/flake.nix

112 lines
3 KiB
Nix
Raw Normal View History

2024-03-13 06:55:17 -05:00
{
description = "My machines";
inputs = {
# Nixpkgs and unstable
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
2024-03-18 16:16:39 -05:00
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# home-manager
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-13 06:55:17 -05:00
# sops-nix
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-18 16:16:39 -05:00
# deploy-rs
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-03-13 06:55:17 -05:00
# VSCode community extensions
nix-vscode-extensions = {
url = "github:nix-community/nix-vscode-extensions";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2024-03-18 04:26:02 -05:00
outputs =
{ self
, nixpkgs
, sops-nix
, ...
} @ inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
# "i686-linux"
"x86_64-linux"
# "aarch64-darwin"
# "x86_64-darwin"
];
in
2024-03-18 16:16:39 -05:00
with inputs; rec {
2024-03-13 06:55:17 -05:00
# Use nixpkgs-fmt for 'nix fmt'
2024-03-18 04:06:00 -05:00
formatter = forAllSystems (system: nixpkgs.legacyPackages."${system}".nixpkgs-fmt);
2024-03-13 06:55:17 -05:00
2024-03-18 16:16:39 -05:00
nixosConfigurations =
let
defaultModules =
# (builtins.attrValues nixosModules) ++
[
sops-nix.nixosModules.sops
];
specialArgs = {
inherit inputs outputs;
};
in
{
nixosvm = nixpkgs.lib.nixosSystem {
inherit specialArgs;
2024-03-13 06:55:17 -05:00
system = "x86_64-linux";
2024-03-18 16:16:39 -05:00
modules = defaultModules ++ [
./nixos/hosts/nixosvm
];
};
2024-03-19 06:51:31 -05:00
dns01 = nixpkgs.lib.nixosSystem {
inherit specialArgs;
system = "aarch64-linux";
modules = defaultModules ++ [
./nixos/hosts/dns01
];
};
2024-03-19 06:53:14 -05:00
dns02 = nixpkgs.lib.nixosSystem {
inherit specialArgs;
system = "aarch64-linux";
modules = defaultModules ++ [
./nixos/hosts/dns02
];
};
2024-03-18 16:16:39 -05:00
# isoimage = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# inherit specialArgs;
# modules = defaultModules ++ [
# "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix"
# { isoImage.squashfsCompression = "gzip -Xcompression-level 1"; }
# ./nixos/iso
# ];
# };
2024-03-13 06:55:17 -05:00
2024-03-18 16:16:39 -05:00
# nix build .#images.rpi4
rpi4 = nixpkgs.lib.nixosSystem {
inherit specialArgs;
modules = defaultModules ++ [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./nixos/hosts/images/sd-image
2024-03-13 06:55:17 -05:00
];
};
2024-03-18 16:16:39 -05:00
};
images.rpi4 = nixosConfigurations.rpi4.config.system.build.sdImage;
2024-03-16 07:46:36 -05:00
};
2024-03-18 16:16:39 -05:00
2024-03-16 07:46:36 -05:00
}