From a12c6266ccb6d4427f0711668c186d68a7c90a15 Mon Sep 17 00:00:00 2001 From: Alexander Kobjolke Date: Wed, 24 Jan 2024 21:50:18 +0100 Subject: [PATCH] thrall: Move most modules from flake to thrall --- flake.nix | 74 +++++++++++++++++++--------------------- hosts/thrall/default.nix | 15 +++----- 2 files changed, 40 insertions(+), 49 deletions(-) diff --git a/flake.nix b/flake.nix index 1b9ab49..32a274f 100644 --- a/flake.nix +++ b/flake.nix @@ -42,46 +42,42 @@ }; }; - outputs = - { home-manager, nixpkgs, nixpkgs-unstable, agenix, snm, ... }@inputs: { - nixosConfigurations."thrall" = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = let - postfix-overlay = final: prev: { - postfix = nixpkgs-unstable.legacyPackages."x86_64-linux".postfix; + outputs = { home-manager, nixpkgs, nixpkgs-unstable, ... }@inputs: { + nixosConfigurations."thrall" = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { inherit inputs; }; + modules = let + postfix-overlay = final: prev: { + postfix = nixpkgs-unstable.legacyPackages."x86_64-linux".postfix; + }; + in [ + ({ inputs, lib, ... }: { + nixpkgs = { + config.allowUnfree = true; + overlays = with inputs; [ emacs.overlay postfix-overlay ]; }; - in [ - ({ inputs, lib, ... }: { - nixpkgs = { - config.allowUnfree = true; - overlays = with inputs; [ emacs.overlay postfix-overlay ]; - }; - nix.registry = lib.mapAttrs (_: value: { flake = value; }) inputs; - }) - snm.nixosModule - ./modules/security.nix - ./hosts/thrall - agenix.nixosModules.age - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.users.alex = import ./home/cli.nix; - } + nix.registry = lib.mapAttrs (_: value: { flake = value; }) inputs; + }) + ./hosts/thrall + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.alex = import ./home/cli.nix; + } + ]; + }; + + nixosConfigurations."dregil" = import ./hosts/dregil { inherit inputs; }; + homeConfigurations = import ./outputs/homeConfigurations inputs; + + nixOnDroidConfigurations.default = with inputs; + nix-on-droid.lib.nixOnDroidConfiguration { + modules = [ + ./hosts/redmi + { nix.registry.nixpkgs.flake = nixpkgs-droid; } + { nix.nixPath = [ "nixpkgs=${nixpkgs-droid}" ]; } ]; }; - - nixosConfigurations."dregil" = import ./hosts/dregil { inherit inputs; }; - homeConfigurations = import ./outputs/homeConfigurations inputs; - - nixOnDroidConfigurations.default = with inputs; - nix-on-droid.lib.nixOnDroidConfiguration { - modules = [ - ./hosts/redmi - { nix.registry.nixpkgs.flake = nixpkgs-droid; } - { nix.nixPath = [ "nixpkgs=${nixpkgs-droid}" ]; } - ]; - }; - }; + }; } diff --git a/hosts/thrall/default.nix b/hosts/thrall/default.nix index 29f0322..a3924be 100644 --- a/hosts/thrall/default.nix +++ b/hosts/thrall/default.nix @@ -2,13 +2,16 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ inputs, config, pkgs, ... }: let authorityFromUrl = url: builtins.head (pkgs.lib.drop 1 (pkgs.lib.splitString "://" url)); in { imports = [ ./hardware-configuration.nix + inputs.snm.nixosModule + inputs.agenix.nixosModules.age + ../../modules/security.nix ../../modules/upgrade-pg-cluster.nix ../../modules/nix-config.nix ../../modules/iohk.nix @@ -135,15 +138,7 @@ in { # List packages installed in system profile. To search, run: # $ nix search wget - environment.systemPackages = with pkgs; [ - wget - rsync - htop - tmux - git - restic # fast and secure backup - rclone - ]; + environment.systemPackages = with pkgs; [ wget rsync htop tmux git rclone ]; # Some programs need SUID wrappers, can be configured further or are # started in user sessions.