Skip to content

erik-sundin-git/nixos

Repository files navigation

Table of Contents

  1. My Nix Configuration
    1. Flake Inputs
    2. Flake outputs
    3. Flake settings
    4. Nixos configurations
      1. Laptop
      2. Desktop
      3. Virtual machine
    5. Flake Packages

My Nix Configuration

My Flake containing my different nixos systems and packages. For Nixos config see config

Flake Inputs

{
  description = "My Nix Configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nixpkgs-stable.url = "github:nixos/nixpkgs?ref=nixos-24.05";
    nixpkgs-patched.url = "github:erik-sundin-git/nixpkgs?ref=picom-ftlabs";

    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    dots = {
      url = "github:erik-sundin-git/dotfiles/nix";
      flake = false;
    };

    neovim.url = "github:erik-sundin-git/neovim";
    stylix.url = "github:danth/stylix";
    install-script.url = "path:./install";
  };

Flake outputs

outputs = {
  self,
  nixpkgs,
  nixpkgs-stable,
  nixpkgs-patched,
  install-script,
  neovim,
  stylix,
  home-manager,
  ...
} @ inputs:

Flake settings

Some settings i use within my flake.

  let
  systemSettings = {
    system = "x86_64-linux"; # system arch
    homeDir = "/home/erik";
    user = "erik";
    wallpaper = ./wallpapers/misc/abstract/kanji-with-blobs_00_1920x1080.png;
  };
  
  pkgs-stable = import nixpkgs-stable {
    system = systemSettings.system;
    config.allowUnfree = true;
  };

  pkgs-patched = import nixpkgs-patched {
    system = systemSettings.system;
    config.allowUnfree = true;
  };

  /*
  * Variables to be used within the configurations
  */
  args = {
    inherit inputs;
    inherit systemSettings;
    inherit pkgs-stable;
    inherit pkgs-patched;
    inherit install-script;
  };
in

Nixos configurations

Laptop

{
nixosConfigurations.yoga = nixpkgs.lib.nixosSystem {
  system = systemSettings.system;
  specialArgs = args;
  modules = [
    stylix.nixosModules.stylix
    home-manager.nixosModules.home-manager
    {
      home-manager.useGlobalPkgs = true;
      home-manager.useUserPackages = true;
      home-manager.users.${systemSettings.user} = import ./home-manager/home.nix;
      home-manager.extraSpecialArgs = {inherit inputs;};
    }
    ./nixos/config.nix
    ./nixos/hosts/yoga/default.nix
    ./nixos/modules/default.nix
  ];
};

Desktop

nixosConfigurations.desktop = nixpkgs.lib.nixosSystem {
  system = systemSettings.system;
  specialArgs = args;
  modules = [
    ./nixos/config.nix
    ./nixos/hosts/desktop/default.nix
    ./nixos/modules/default.nix
  ];
};

Virtual machine

nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
  system = systemSettings.system;
  specialArgs = args;
  modules = [
    ./nixos/hosts/vm/default.nix
  ];
};

Flake Packages

    packages.${systemSettings.system} = {
      install = install-script.packages.${systemSettings.system}.install; #basically just clones the repo atm.
    };
  };
}

About

nixosconfig

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published