Migrate to home-manager

finchie
Mar 6, 2024, 6:04 AM
5FI47NSAKGGGPLIQSUI3PWOPVYJT7ZYKWVLARNAMUBBYYCUBIOZAC

Dependencies

Change contents

  • file addition: home.nix (----------)
    [21.1]
    # Template from https://nix-community.github.io/home-manager/index.xhtml#sec-usage-configuration
    { config, pkgs, ... }:
    let
    python-packages = ps: with ps; [
    requests
    discordpy
    pandas
    numpy
    nose
    matplotlib
    seaborn
    basemap
    geopandas
    pyshp
    jupyter
    notebook
    ipython
    ipykernel
    openpyxl
    ];
    in
    {
    home.username = "finchie";
    home.homeDirectory = "/home/finchie";
    home.stateVersion = "23.11";
    programs.home-manager.enable = true;
    home.packages = with pkgs; [
    (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
    extensions = [ "rust-src" "llvm-tools" "rustc-codegen-cranelift" ];
    targets = [ "riscv32imc-unknown-none-elf" "x86_64-unknown-none" "wasm32-unknown-unknown" "wasm32-wasi" ];
    }))
    (python3.withPackages python-packages)
    latest.firefox-nightly-bin
    latest.thunderbird-daily-bin
    neofetch
    nushellFull
    pandoc
    biome
    alacritty
    helix
    direnv
    discord-canary
    vscode
    git
    steam
    sidequest
    ripgrep
    arduino
    bat
    bottom
    du-dust
    asciinema
    lapce
    fontconfig
    zoxide
    fd
    tokei
    hotspot
    onlyoffice-bin
    hyperfine
    spot
    topgrade
    steam-run
    lutris
    mdbook
    difftastic
    lurk
    typst
    obs-studio
    pkg-config
    openssl
    libiconv
    zstd
    xxHash
    yarn
    nodejs
    libudev-zero
    qemu
    # llvmPackages.bintools
    xorg.libX11
    xorg.libxkbfile
    libsecret
    mold
    # clang_14
    cmake
    fontconfig
    freetype
    ninja
    ruff
    libsodium
    ffmpeg
    tk
    zip
    gdb
    sccache
    gcc
    dogdns
    gnomeExtensions.pop-shell
    # lldb
    gnumake
    lld
    notion-app-enhanced
    nixpkgs-fmt
    jujutsu
    bitwarden-desktop
    ];
    }
  • edit in flake.nix at line 5
    [11.1626][11.1626:1707]()
    # normal nix stuff
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  • edit in flake.nix at line 17
    [5.182]
    [11.2081]
    home-manager = {
    url = "github:nix-community/home-manager";
    inputs.nixpkgs.follows = "nixpkgs";
    };
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  • replacement in flake.nix at line 23
    [11.2086][11.2086:2593](),[11.2593][11.2593:3158]()
    # what will be produced (i.e. the build)
    outputs = inputs: {
    nixosConfigurations."nixos" =
    let system = "x86_64-linux";
    python-packages = ps: with ps; [
    requests
    discordpy
    pandas
    numpy
    # spacy
    nose
    matplotlib
    seaborn
    basemap
    geopandas
    pyshp
    jupyter
    notebook
    ipython
    ipykernel
    openpyxl
    ];
    in inputs.nixpkgs.lib.nixosSystem {
    inherit system;
    modules = [({pkgs, config, ... }: {
    imports = [ ./configuration.nix ];
    config = {
    nix.settings = {
    # add binary caches
    trusted-public-keys = [
    "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
    "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
    ];
    substituters = [
    "https://cache.nixos.org"
    "https://nixpkgs-wayland.cachix.org"
    [11.2086]
    [11.3158]
    # Boilerplate from https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-nixos-module
    outputs = inputs@{ nixpkgs, home-manager, ... }: {
    nixosConfigurations = {
    # A gotcha: nixos is the HOSTNAME, need to change this eventually
    nixos = nixpkgs.lib.nixosSystem {
    system = "x86_64-linux";
    modules = [
    ./configuration.nix
    home-manager.nixosModules.home-manager
    {
    home-manager.useGlobalPkgs = true;
    home-manager.useUserPackages = true;
    home-manager.users.finchie = import ./home.nix;
    }
    ({
    nixpkgs.overlays = with inputs; [
    nixpkgs-wayland.overlay
    rust-overlay.overlays.default
    mozilla-overlay.overlay
  • replacement in flake.nix at line 44
    [11.3173][11.3173:3476](),[11.3476][2.0:96](),[2.96][11.3476:3556](),[11.3476][11.3476:3556](),[11.3556][11.3556:3598](),[11.3598][5.183:219](),[5.219][11.3642:3655](),[11.3642][11.3642:3655](),[11.3655][3.0:11](),[3.11][11.3656:3804](),[11.3656][11.3656:3804](),[11.3804][11.3804:3891](),[11.3891][3.12:110](),[3.110][11.3955:4092](),[11.3955][11.3955:4092](),[11.4092][11.4092:4182](),[11.4182][5.220:261](),[5.261][11.4182:5601](),[11.4182][11.4182:5601](),[11.5601][11.0:20](),[11.20][11.0:16](),[11.16][11.0:19](),[11.19][11.0:38](),[11.38][10.0:17](),[11.16][11.5601:5636](),[10.17][11.5601:5636](),[11.19][11.5601:5636](),[11.20][11.5601:5636](),[11.38][11.5601:5636](),[11.5601][11.5601:5636]()
    extra-substituters = [
    # Nix community's cache server
    "https://nix-community.cachix.org"
    ];
    extra-trusted-public-keys = [
    "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
    ];
    };
    # Automatically hard-link where appropriate
    nix.optimise.automatic = true;
    nixpkgs.overlays = with inputs; [
    nixpkgs-wayland.overlay
    rust-overlay.overlays.default
    mozilla-overlay.overlay
    ];
    # or, pull specific packages (built against inputs.nixpkgs, usually `nixos-unstable`)
    environment.systemPackages = with pkgs; [
    (rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
    extensions = [ "rust-src" "llvm-tools-preview" "rustc-codegen-cranelift-preview" ];
    targets = [ "riscv32imc-unknown-none-elf" "x86_64-unknown-none" "wasm32-unknown-unknown" "wasm32-wasi" ];
    }))
    (python3.withPackages python-packages)
    latest.firefox-nightly-bin
    latest.thunderbird-daily-bin
    neofetch
    gnome.gnome-remote-desktop # Needed for screen sharing? see https://bbs.archlinux.org/viewtopic.php?id=283835
    nushellFull
    pandoc
    biome
    alacritty
    helix
    direnv
    discord-canary
    vscode
    git
    pijul
    steam
    sidequest
    ripgrep
    arduino
    bat
    bottom
    du-dust
    asciinema
    lapce
    fontconfig
    zoxide
    fd
    tokei
    hotspot
    onlyoffice-bin
    hyperfine
    psst
    bottles
    topgrade
    thunderbird-bin
    rustdesk
    steam-run
    lutris
    mdbook
    difftastic
    lurk
    typst
    obs-studio
    pkg-config
    openssl
    libiconv
    zstd
    xxHash
    yarn
    nodejs
    libudev-zero
    qemu
    llvmPackages.bintools
    xorg.libX11
    xorg.libxkbfile
    libsecret
    mold
    clang_14
    cmake
    fontconfig
    freetype
    ninja
    ruff
    libsodium
    ffmpeg
    tk
    zip
    gdb
    sccache
    gcc
    dogdns
    gnomeExtensions.pop-shell
    lldb
    ];
    };
    })];
    [11.3173]
    [11.5636]
    })
    ];
    };
  • replacement in configuration.nix at line 9
    [11.5941][11.5941:5991]()
    [ # Include the results of the hardware scan.
    [11.5941]
    [11.5991]
    [
    # Include the results of the hardware scan.
  • replacement in configuration.nix at line 16
    [11.6120][6.0:3]()
    [11.6120]
    [6.3]
    # Setup binary caching
    nix.settings = {
    # add binary caches
    trusted-public-keys = [
    "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
    "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
    ];
    substituters = [
    "https://cache.nixos.org"
    "https://nixpkgs-wayland.cachix.org"
    ];
    extra-substituters = [
    # Nix community's cache server
    "https://nix-community.cachix.org"
    ];
    extra-trusted-public-keys = [
    "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
    ];
    };
    # Automatically hard-link where appropriate
    nix.optimise.automatic = true;
  • replacement in configuration.nix at line 59
    [11.86][9.0:3]()
    [11.86]
    [9.3]
  • replacement in configuration.nix at line 66
    [11.6299][11.6299:6304]()
    [11.6299]
    [11.6304]
  • replacement in configuration.nix at line 81
    [11.6849][7.0:3]()
    [11.6849]
    [7.3]
  • replacement in configuration.nix at line 84
    [11.6933][11.6933:6936]()
    [7.103]
    [8.0]
  • replacement in configuration.nix at line 87
    [8.75][8.75:78]()
    [8.75]
    [11.6936]
  • replacement in configuration.nix at line 97
    [11.7240][11.39:42]()
    [11.7240]
    [11.42]
  • replacement in configuration.nix at line 110
    [11.7482][11.7482:7578](),[11.7578][4.0:23](),[4.23][11.7596:7605](),[11.7596][11.7596:7605](),[11.7605][4.24:188]()
    enableDefaultPackages = true;
    fontDir.enable = true;
    packages = with pkgs; [
    intel-one-mono
    ];
    fontconfig = {
    enable = true;
    defaultFonts = {
    monospace = ["Intel One Mono"];
    sansSerif = ["Intel One Mono"];
    };
    [11.7482]
    [4.188]
    enableDefaultPackages = true;
    fontDir.enable = true;
    packages = with pkgs; [
    intel-one-mono
    ];
    fontconfig = {
    enable = true;
    defaultFonts = {
    monospace = [ "Intel One Mono" ];
    sansSerif = [ "Intel One Mono" ];
  • replacement in configuration.nix at line 121
    [4.197][4.197:204](),[4.204][11.7641:7652](),[11.7641][11.7641:7652]()
    };
    [4.197]
    [11.7652]
    };
    };
  • edit in configuration.nix at line 136
    [11.7915]
    [11.7915]
  • replacement in configuration.nix at line 159
    [11.8550][11.8550:8587]()
    nixpkgs.config.allowUnfree = true;
    [11.8550]
    [11.8587]
    nixpkgs.config = {
    allowUnfree = true;
    nvidia.acceptLicense = true;
    };