Added Variables For Username & Hostname in Flake

This commit is contained in:
Tyler Kelley 2024-01-12 01:07:42 -06:00
parent 0eb4e73b50
commit 287974c466
3 changed files with 7 additions and 7 deletions

View File

@ -6,13 +6,13 @@
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/Hyprland";
hostname = "hyprnix";
username = "zaney";
};
outputs = inputs@{ nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
hostname = "hyprnix";
username = "zaney";
pkgs = import nixpkgs {
inherit system;
config = {
@ -22,12 +22,12 @@
in {
nixosConfigurations = {
laptop = nixpkgs.lib.nixosSystem {
specialArgs = { inherit system; inherit inputs; };
specialArgs = { inherit system; inherit inputs; inherit username; inherit hostname };
modules = [ ./laptop/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${username} = import ./home.nix;
home-manager.users.zaney = import ./home.nix;
}
];
};

View File

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, username, ... }:
{
home.username = ${username};

View File

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ inputs, config, pkgs, ... }:
{ inputs, config, pkgs, username, hostname, ... }:
{
imports =
@ -16,7 +16,7 @@
boot.kernelModules = [ "v4l2loopback" ];
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
networking.hostName = "hyprnix"; # Define your hostname.
networking.hostName = ${hostname}; # Define your hostname.
# Enable networking
networking.networkmanager.enable = true;