From aeab773e97bc2fae268091f9cc963f3cb0492b9c Mon Sep 17 00:00:00 2001 From: buffet Date: Mon, 17 Jul 2023 17:29:13 +0200 Subject: [PATCH] feat: fork config to enable alice migration --- alice/default.nix | 28 ++++++++++++ fanya.nix => common.nix | 38 ++++++++-------- fanya/default.nix | 18 ++++++++ .../hardware-configuration.nix | 0 flake.nix | 43 ++++++++++++------- programs/default.nix | 20 --------- system.nix | 15 ------- theme.nix | 1 - 8 files changed, 91 insertions(+), 72 deletions(-) create mode 100644 alice/default.nix rename fanya.nix => common.nix (79%) create mode 100644 fanya/default.nix rename hardware-configuration.nix => fanya/hardware-configuration.nix (100%) delete mode 100644 programs/default.nix diff --git a/alice/default.nix b/alice/default.nix new file mode 100644 index 0000000..add19c2 --- /dev/null +++ b/alice/default.nix @@ -0,0 +1,28 @@ +_: let + password = "$y$j9T$g/a4KaQ5VitWI9ZtAh9i3/$wjejk5W8LMc0gaVgw69kwrKLqBgZ95ekaOl/GaTOZVC"; +in { + imports = [ + ./hardware-configuration.nix + ]; + + # Don't change! + system.stateVersion = "23.05"; + home-manager.users.buffet.home.stateVersion = "23.05"; + + users.users.buffet.hashedPassword = password; + users.users.root.hashedPassword = password; + + networking.hostName = "alice"; + + services.tlp = { + enable = true; + + settings = { + START_CHARGE_THRESH_BAT0 = 75; + STOP_CHARGE_THRESH_BAT0 = 80; + + START_CHARGE_THRESH_BAT1 = 75; + STOP_CHARGE_THRESH_BAT1 = 80; + }; + }; +} diff --git a/fanya.nix b/common.nix similarity index 79% rename from fanya.nix rename to common.nix index 79fcff8..79278ea 100644 --- a/fanya.nix +++ b/common.nix @@ -1,19 +1,21 @@ -{ - pkgs, - agenix, - home-manager, - nur, - ... -}: let - password = "$6$FHwMlUwmRdAsPqS4$4XND0L0EEVf2Mhc/tvo6y3ZLIrMTOlsIZrG3w69EeXvtVZhdeNyoDOkPNIe.GBB8.PrchuUKDacqbvcvyuPkt0"; -in { +{pkgs, ...}: { imports = [ - agenix.nixosModules.default - home-manager.nixosModule - nur.nixosModules.nur - ./impermanence.nix - ./programs - ./system.nix + ./programs/bash.nix + ./programs/borg.nix + ./programs/cargo.nix + ./programs/firefox.nix + ./programs/foot.nix + ./programs/git.nix + ./programs/gpg.nix + ./programs/ime.nix + ./programs/lsd.nix + ./programs/mako.nix + ./programs/newsboat.nix + ./programs/nvim.nix + ./programs/pipewire.nix + ./programs/sbcl.nix + ./programs/sioyek.nix + ./programs/sway.nix ]; environment.systemPackages = with pkgs; [ @@ -22,12 +24,10 @@ in { ]; fonts.fonts = with pkgs; [ - (nerdfonts.override {fonts = ["Go-Mono"];}) apl386 dejavu_fonts noto-fonts noto-fonts-cjk - source-han-serif ]; home-manager.users.buffet = { @@ -105,11 +105,8 @@ in { "uinput" "wheel" ]; - hashedPassword = password; }; - users.users.root.hashedPassword = password; - systemd.coredump.enable = true; hardware = { @@ -133,7 +130,6 @@ in { enableNotifications = true; }; - tlp.enable = true; upower.enable = true; systembus-notify.enable = true; }; diff --git a/fanya/default.nix b/fanya/default.nix new file mode 100644 index 0000000..624018f --- /dev/null +++ b/fanya/default.nix @@ -0,0 +1,18 @@ +_: let + password = "$6$FHwMlUwmRdAsPqS4$4XND0L0EEVf2Mhc/tvo6y3ZLIrMTOlsIZrG3w69EeXvtVZhdeNyoDOkPNIe.GBB8.PrchuUKDacqbvcvyuPkt0"; +in { + imports = [ + ./hardware-configuration.nix + ]; + + # Don't change! + system.stateVersion = "22.05"; + home-manager.users.buffet.home.stateVersion = "22.05"; + + users.users.buffet.hashedPassword = password; + users.users.root.hashedPassword = password; + + networking.hostName = "fanya"; + + services.tlp.enable = true; +} diff --git a/hardware-configuration.nix b/fanya/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to fanya/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 03aa961..93d8658 100644 --- a/flake.nix +++ b/flake.nix @@ -68,24 +68,37 @@ }; outputs = { - nixpkgs, + agenix, + home-manager, + nur, nixpkgs-unstable, + nixpkgs, ... } @ args: { - nixosConfigurations.fanya = let - system = "x86_64-linux"; - overlay-unstable = final: prev: { - unstable = nixpkgs-unstable.legacyPackages.${prev.system}; - }; - in - nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = args; - modules = [ - ./fanya.nix + nixosConfigurations = let + mkSystem = system: module: + nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = args; + modules = let + overlay-unstable = final: prev: { + unstable = nixpkgs-unstable.legacyPackages.${prev.system}; + }; + in [ + module - (_: {nixpkgs.overlays = [(import ./overlay args) overlay-unstable];}) - ]; - }; + agenix.nixosModules.default + home-manager.nixosModule + nur.nixosModules.nur + ./common.nix + ./impermanence.nix + ./system.nix + (_: {nixpkgs.overlays = [(import ./overlay args) overlay-unstable];}) + ]; + }; + in { + alice = mkSystem "x86_64-linux" ./alice; + fanya = mkSystem "x86_64-linux" ./fanya; + }; }; } diff --git a/programs/default.nix b/programs/default.nix deleted file mode 100644 index d7534a8..0000000 --- a/programs/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -_: { - imports = [ - ./bash.nix - ./borg.nix - ./cargo.nix - ./firefox.nix - ./foot.nix - ./git.nix - ./gpg.nix - ./ime.nix - ./lsd.nix - ./mako.nix - ./newsboat.nix - ./nvim.nix - ./pipewire.nix - ./sbcl.nix - ./sioyek.nix - ./sway.nix - ]; -} diff --git a/system.nix b/system.nix index 5b222c9..95e4a46 100644 --- a/system.nix +++ b/system.nix @@ -3,18 +3,9 @@ nixpkgs-unstable, ... }: { - imports = [ - ./hardware-configuration.nix - ]; - - # Don't change! - system.stateVersion = "22.05"; - home-manager.users.buffet.home.stateVersion = "22.05"; - time.timeZone = "Europe/Berlin"; i18n.defaultLocale = "en_US.UTF-8"; - #boot.tmpOnTmpfs = true; boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; @@ -27,12 +18,6 @@ }; networking = { - useDHCP = false; - interfaces = { - enp0s25.useDHCP = true; - wlp3s0.useDHCP = true; - }; - hostName = "fanya"; networkmanager.enable = true; nameservers = ["1.1.1.1"]; }; diff --git a/theme.nix b/theme.nix index 5ebd5b5..d81f3da 100644 --- a/theme.nix +++ b/theme.nix @@ -2,7 +2,6 @@ light = false; font = { - #family = "GoMono Nerd Font"; family = "APL386 Unicode"; size = 7; };