mirror of
https://github.com/divnix/digga.git
synced 2024-12-23 16:11:51 +03:00
legacy: ensure config exists
This commit is contained in:
parent
f69c5a59f1
commit
063d05c680
@ -3,16 +3,21 @@
|
||||
# flake support (e.g `nixos-option`), can work as expected.
|
||||
{ lib, ... }:
|
||||
let
|
||||
host = lib.fileContents /etc/hostname;
|
||||
hostname = lib.fileContents /etc/hostname;
|
||||
host = "/etc/nixos/hosts/${hostname}.nix";
|
||||
config =
|
||||
if (builtins.pathExists host)
|
||||
then [ host ]
|
||||
else [ /etc/nixos/hosts/NixOS.nix ];
|
||||
in
|
||||
{
|
||||
imports = builtins.attrValues (import ./modules) ++ [
|
||||
"${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos"
|
||||
/etc/nixos/profiles/core.nix
|
||||
"/etc/nixos/hosts/${host}.nix"
|
||||
];
|
||||
] ++ config;
|
||||
|
||||
networking.hostName = host;
|
||||
|
||||
networking.hostName = hostname;
|
||||
nix.nixPath = [
|
||||
"nixpkgs=${<nixpkgs>}"
|
||||
"nixos-config=/etc/nixos/configuration.nix"
|
||||
|
Loading…
Reference in New Issue
Block a user