Compare commits

..

3 commits

5 changed files with 42 additions and 31 deletions

View file

@ -3,9 +3,13 @@
pkgs,
lib,
modulesPath,
flake-inputs,
...
}: {
imports = [
flake-inputs.sops-nix.nixosModules.sops
flake-inputs.tlaternet-webserver.nixosModules.default
"${modulesPath}/profiles/headless.nix"
"${modulesPath}/profiles/minimal.nix"
(import ../modules)

View file

@ -2,6 +2,7 @@
pkgs,
config,
lib,
flake-inputs,
...
}: let
inherit (lib.strings) concatMapStringsSep;
@ -12,6 +13,7 @@
in {
services.matrix-conduit = {
enable = true;
package = flake-inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.conduit-matrix;
settings.global = {
address = "127.0.0.1";
server_name = domain;

17
flake.lock generated
View file

@ -378,6 +378,22 @@
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1677342105,
"narHash": "sha256-kv1fpkfCJGb0M+LZaCHFUuIS9kRIwyVgupHu86Y28nc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "b1f87ca164a9684404c8829b851c3586c4d9f089",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1673345971,
@ -479,6 +495,7 @@
"inputs": {
"deploy-rs": "deploy-rs",
"nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable",
"nvfetcher": "nvfetcher",
"sops-nix": "sops-nix",
"tlaternet-webserver": "tlaternet-webserver"

View file

@ -3,6 +3,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
deploy-rs.url = "github:serokell/deploy-rs";
sops-nix = {
url = "github:Mic92/sops-nix";
@ -24,8 +25,8 @@
sops-nix,
nvfetcher,
deploy-rs,
tlaternet-webserver,
}: let
...
} @ inputs: let
system = "x86_64-linux";
in {
##################
@ -33,9 +34,14 @@
##################
nixosConfigurations = {
# The actual system definition
tlaternet = self.lib.makeNixosSystem {
tlaternet = nixpkgs.lib.nixosSystem {
inherit system;
extraModules = [(import ./configuration/hardware-specific/linode)];
specialArgs.flake-inputs = inputs;
modules = [
./configuration
./configuration/hardware-specific/linode
];
};
};
@ -63,19 +69,21 @@
####################
# Helper functions #
####################
lib = import ./lib {
inherit nixpkgs sops-nix tlaternet-webserver;
lib = nixpkgs.lib;
};
lib = import ./lib {inherit (nixpkgs) lib;};
###################
# Utility scripts #
###################
packages.${system} = let
inherit (nixpkgs.legacyPackages.${system}) writeShellScript;
vm = self.lib.makeNixosSystem {
vm = nixpkgs.lib.nixosSystem {
inherit system;
extraModules = [(import ./configuration/hardware-specific/vm.nix)];
specialArgs.flake-inputs = inputs;
modules = [
./configuration
./configuration/hardware-specific/vm.nix
];
};
in {
default = vm.config.system.build.vm;

View file

@ -1,9 +1,4 @@
{
lib,
nixpkgs,
sops-nix,
tlaternet-webserver,
}: let
{lib}: let
inherit (lib.attrsets) mapAttrsToList;
inherit (lib.strings) concatStringsSep;
in {
@ -12,19 +7,4 @@ in {
(mapAttrsToList
(host: vm: "hostfwd=::${host}-:${vm}")
portMapping);
makeNixosSystem = {
system,
extraModules,
}:
nixpkgs.lib.nixosSystem {
inherit system;
modules =
[
sops-nix.nixosModules.sops
tlaternet-webserver.nixosModules.default
(import ../configuration)
]
++ extraModules;
};
}