-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving all nixos config into a flake
- Loading branch information
Showing
12 changed files
with
458 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
# NixOS setup | ||
|
||
## Machine config | ||
NixOS setup using flakes. | ||
|
||
```bash | ||
$ sudo cat /etc/nixos/configuration.nix | ||
{ config, pkgs, ... }: | ||
|
||
{ | ||
imports = [ | ||
/home/knarf/configs/os/nixos/machine/configuration.nix | ||
]; | ||
} | ||
``` | ||
This way I can version control my config by having an empty configurations.nix that just imports the one in the repo. | ||
After making changes simply run: | ||
```bash | ||
sudo nixos-rebuild switch | ||
sudo nixos-rebuild switch --flake . # To rebuild the machine | ||
home-manager switch --flake . | ||
``` | ||
|
||
## home-manager | ||
[home-manager guide](https://nix-community.github.io/home-manager/) | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
description = "NixOS and Home-manager config"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; | ||
|
||
home-manager = { | ||
url = "github:nix-community/home-manager"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
|
||
hyprland = { | ||
url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
|
||
outputs = { nixpkgs, home-manager, hyprland, ... } @ inputs: | ||
let | ||
system = "x86_64-linux"; | ||
pkgs = import nixpkgs { | ||
system = "${system}"; | ||
config = { | ||
allowUnfree = true; | ||
}; | ||
}; | ||
user = "knarf"; | ||
in { | ||
# Machine | ||
nixosConfigurations."nixos" = nixpkgs.lib.nixosSystem { | ||
inherit pkgs; | ||
inherit system; | ||
|
||
modules = [ | ||
./machine/configuration.nix | ||
home-manager.nixosModules.home-manager | ||
{ | ||
home-manager.useGlobalPkgs = true; | ||
home-manager.useUserPackages = true; | ||
home-manager.users.${user} = import ./home-manager/home.nix; | ||
} | ||
]; | ||
|
||
specialArgs = {inherit user;}; | ||
}; | ||
|
||
# Home manager | ||
homeConfigurations."${user}" = home-manager.lib.homeManagerConfiguration { | ||
inherit pkgs; | ||
|
||
modules = [ | ||
hyprland.homeManagerModules.default | ||
./home-manager/home.nix | ||
]; | ||
|
||
extraSpecialArgs = {inherit user;}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ config, pkgs, ... }: | ||
|
||
{ | ||
nixpkgs = { | ||
config = { | ||
allowUnfree = true; | ||
allowUnfreePredicate = (_: true); | ||
}; | ||
}; | ||
|
||
home.packages = [ | ||
# Browsers | ||
pkgs.firefox | ||
|
||
# Chat | ||
pkgs.discord | ||
|
||
# Multimedia | ||
pkgs.spotify | ||
pkgs.vlc | ||
pkgs.audacity | ||
|
||
# Streaming | ||
pkgs.obs-studio | ||
|
||
# 3D / CAD / Game engines | ||
# pkgs.blender | ||
# pkgs.freecad | ||
pkgs.openscad | ||
pkgs.godot_4 | ||
|
||
# Other | ||
pkgs.webtorrent_desktop | ||
pkgs.obsidian | ||
]; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.