From 5558a65a503631fbb72e451fcb7f83d6015134fa Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Wed, 23 Feb 2022 12:40:21 +0100 Subject: [PATCH] moved to flakes --- capibara.nix | 19 +++------- flake.lock | 63 +++++++++++++++++++++++++++++++ flake.nix | 35 +++++++++++++++++ home/browsers/firefox/default.nix | 47 ++++++++++------------- home/mail/default.nix | 3 +- home/maker/default.nix | 4 +- home/nixos-common.nix | 11 ++---- nixos/common.nix | 20 +++------- trantor.nix | 19 +++------- 9 files changed, 141 insertions(+), 80 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/capibara.nix b/capibara.nix index 44d70df..586294f 100644 --- a/capibara.nix +++ b/capibara.nix @@ -2,22 +2,13 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, inputs, pkgs, ... }: -let - home-manager = builtins.fetchTarball { - url = - # "https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz"; - "https://github.com/nix-community/home-manager/archive/master.tar.gz"; - }; -in { - imports = [ - ./nixos/hardware-configuration/capibara.nix - ./nixos/common.nix - "${home-manager}/nixos" - ]; +{ + imports = [ ./nixos/hardware-configuration/capibara.nix ./nixos/common.nix ]; - home-manager.users.rilla = import home/capibara.nix; + home-manager.users.rilla.imports = + [ home/capibara.nix "${inputs.impermanence}/home-manager.nix" ]; #fileSystems = { # "/home/rilla/Music" = { diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..582d03c --- /dev/null +++ b/flake.lock @@ -0,0 +1,63 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1645557328, + "narHash": "sha256-7PCAESO8HxuSk1hH1J2ld+kK6fugFqNd+vqIXSGz1ag=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "838d40d61a91e3807836545c4b420572ab2d62eb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "impermanence": { + "locked": { + "lastModified": 1644791231, + "narHash": "sha256-iDihsF1fUMK4xXiUudPnDM3veH1LXbbxfP9Lzekw9iU=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "635bcd2d88739197a0b584aa9fadaa53c717a853", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1645433236, + "narHash": "sha256-4va4MvJ076XyPp5h8sm5eMQvCrJ6yZAbBmyw95dGyw4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7f9b6e2babf232412682c09e57ed666d8f84ac2d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "impermanence": "impermanence", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..0c58462 --- /dev/null +++ b/flake.nix @@ -0,0 +1,35 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + impermanence.url = "github:nix-community/impermanence"; + }; + outputs = { self, nixpkgs, home-manager, impermanence }@inputs: { + nixosConfigurations = { + trantor = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs.inputs = inputs; + + modules = [ + ./trantor.nix + home-manager.nixosModules.home-manager + impermanence.nixosModules.impermanence + ]; + }; + + capibara = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs.inputs = inputs; + + modules = [ + ./capibara.nix + home-manager.nixosModules.home-manager + impermanence.nixosModules.impermanence + ]; + }; + }; + }; +} diff --git a/home/browsers/firefox/default.nix b/home/browsers/firefox/default.nix index e3f7884..3708751 100644 --- a/home/browsers/firefox/default.nix +++ b/home/browsers/firefox/default.nix @@ -1,37 +1,29 @@ { config, pkgs, ... }: - { - nixpkgs.config = { - packageOverrides = pkgs: { - nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { - inherit pkgs; - }; - }; - }; # nix-env -f '' -qaP -A nur.repos.rycee.firefox-addons programs.firefox = { enable = true; # maybe enable tridactyl? # nix-env -f '' -qaP -A nur.repos.rycee.firefox-addons - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - browserpass - canvasblocker - clearurls - cookie-autodelete - darkreader - floccus - foxyproxy-standard - https-everywhere - i-dont-care-about-cookies - localcdn - noscript - privacy-possum - privacy-redirect - ublock-origin - vimium - # todo: AdNauseam, wallabagger, DownThemAll! Wayback Machine - ]; + # extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + # browserpass + # canvasblocker + # clearurls + # cookie-autodelete + # darkreader + # floccus + # foxyproxy-standard + # https-everywhere + # i-dont-care-about-cookies + # localcdn + # noscript + # privacy-possum + # privacy-redirect + # ublock-origin + # vimium + # # todo: AdNauseam, wallabagger, DownThemAll! Wayback Machine + # ]; profiles = { default = { id = 0; @@ -40,7 +32,8 @@ # settings = import ./arkenfox // { settings = { # change some values from arkenfox's defaults - "privacy.resistFingerprinting" = false; # if true, this would the window size to rounded dimensions, which is too annoying on a tiling window manager + "privacy.resistFingerprinting" = + false; # if true, this would the window size to rounded dimensions, which is too annoying on a tiling window manager "extensions.pocket.enabled" = false; "identity.fxaccounts.enabled" = false; "browser.search.suggest.enabled" = true; diff --git a/home/mail/default.nix b/home/mail/default.nix index c1a0458..ab5f82d 100644 --- a/home/mail/default.nix +++ b/home/mail/default.nix @@ -6,5 +6,6 @@ in { home.packages = [ mailsync pkgs.urlscan pkgs.abook ]; programs.neomutt.settings.query_command = ''"${pkgs.abook}/bin/abook --mutt-query '%s'"''; - programs.alot.enable = true; + # programs.alot.enable = true; + programs.alot.enable = false; } diff --git a/home/maker/default.nix b/home/maker/default.nix index cb21c5a..7bafb61 100644 --- a/home/maker/default.nix +++ b/home/maker/default.nix @@ -3,8 +3,8 @@ { home.packages = [ pkgs.esphome - pkgs.freecad - pkgs.kicad-small + # pkgs.freecad + # pkgs.kicad-small pkgs.meshlab pkgs.openscad pkgs.slic3r diff --git a/home/nixos-common.nix b/home/nixos-common.nix index 1990f32..b57f606 100644 --- a/home/nixos-common.nix +++ b/home/nixos-common.nix @@ -1,11 +1,6 @@ -{ config, pkgs, ... }: +{ config, inputs, pkgs, ... }: -let - impermanence = builtins.fetchTarball { - url = "https://github.com/nix-community/impermanence/archive/master.tar.gz"; - }; - -in { +{ # Let Home Manager install and manage itself. # programs.home-manager.enable = true; @@ -15,7 +10,6 @@ in { home.homeDirectory = "/home/rilla"; imports = [ - "${impermanence}/home-manager.nix" ./arduino ./barrier ./browsers @@ -59,6 +53,7 @@ in { ".local/share/mpd" ".local/share/webkitgtk" ".mozilla" + ".librewolf" ".newsboat" ".vdirsyncer" ]; diff --git a/nixos/common.nix b/nixos/common.nix index ecb653b..ccb544e 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -1,19 +1,11 @@ { config, pkgs, ... }: -let - impermanence = builtins.fetchTarball { - url = "https://github.com/nix-community/impermanence/archive/master.tar.gz"; - }; -in { - imports = [ "${impermanence}/nixos.nix" ]; - - nixpkgs.config = { - packageOverrides = pkgs: { - nur = import (builtins.fetchTarball - "https://github.com/nix-community/NUR/archive/master.tar.gz") { - inherit pkgs; - }; - }; +{ + nix = { + package = pkgs.nixUnstable; + extraOptions = '' + experimental-features = nix-command flakes + ''; }; # boot.binfmt.emulatedSystems = [ "aarch64-linux" "qemu-aarch64" ]; diff --git a/trantor.nix b/trantor.nix index d0678b2..a257cb6 100644 --- a/trantor.nix +++ b/trantor.nix @@ -2,22 +2,13 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: +{ config, inputs, pkgs, ... }: -let - home-manager = builtins.fetchTarball { - url = - # "https://github.com/nix-community/home-manager/archive/release-21.11.tar.gz"; - "https://github.com/nix-community/home-manager/archive/master.tar.gz"; - }; -in { - imports = [ - ./nixos/hardware-configuration/trantor.nix - ./nixos/common.nix - "${home-manager}/nixos" - ]; +{ + imports = [ ./nixos/hardware-configuration/trantor.nix ./nixos/common.nix ]; - home-manager.users.rilla = import home/trantor.nix; + home-manager.users.rilla.imports = + [ home/trantor.nix "${inputs.impermanence}/home-manager.nix" ]; fileSystems = { "/boot/efi" = {