Skip to content

Commit

Permalink
nix: move to flake-parts
Browse files Browse the repository at this point in the history
hooo boy wth all in a days work
  • Loading branch information
luqmanishere committed Apr 8, 2024
1 parent bf45821 commit aa7236e
Show file tree
Hide file tree
Showing 132 changed files with 3,978 additions and 2,031 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 140
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
7 changes: 7 additions & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Default settings will be applied by .editorconfig
editorconfig: true

# Extra settings
singleQuote: true
trailingComma: all
useTabs: false
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
2. Setup impermeanance (if used)

3. Setup secureboot keys (if used)

```bash
sudo sbctl create-keys
```

## To Install

```bash
git clone https://github.com/luqmanishere/nix
cd nix
Expand All @@ -28,5 +30,6 @@ sudo nixos-rebuild switch --flake .#hostname
```

## Machine names:
* asuna - Honor MagicBook Pro
* kurumi - VirtualBox VM

- asuna - Honor MagicBook Pro
- kurumi - VirtualBox VM
222 changes: 222 additions & 0 deletions archives/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
{
description = "solemnattic's nix config";

inputs = {
# Nixpkgs unstable
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haumea = {
url = "github:nix-community/haumea/v0.2.2";
inputs.nixpkgs.follows = "nixpkgs";
};

impermanence.url = "github:nix-community/impermanence";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};

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

hyprland = {
url = "github:hyprwm/Hyprland/v0.37.1";
inputs.nixpkgs.follows = "nixpkgs"; # MESA/OpenGL HW workaround
};
hypridle = {
url = "github:hyprwm/hypridle/4395339a2dc410bcf49f3e24f9ed3024fdb25b0a";
};
hyprlock = {
url = "github:hyprwm/hyprlock/2ae79757d5e5c48de2f4284992a6bfa265853a2d";
};

wayper.url = "github:luqmanishere/wayper";
anyrun.url = "github:Kirottu/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
xremap-flake.url = "github:xremap/nix-flake";
ags.url = "github:Aylur/ags/v1.8.0";

agenix.url = "github:ryantm/agenix";

nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
emacs-overlay.url = "github:nix-community/emacs-overlay";

devenv.url = "github:cachix/devenv/rust-rewrite";
nil.url = "github:oxalica/nil";
alejandra = {
url = "github:kamadorueda/alejandra/3.0.0";
inputs.nixpkgs.follows = "nixpkgs";
};

prismlauncher.url = "github:PrismLauncher/PrismLauncher";

nixos-wsl.url = "github:nix-community/NixOS-WSL";
# hardware.url = "github:nixos/nixos-hardware";

# Shameless plug: looking for a way to nixify your themes and make
# everything match nicely? Try nix-colors!
# nix-colors.url = "github:misterio77/nix-colors";
};

nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};

outputs = {
self,
nixpkgs,
home-manager,
devenv,
...
} @ inputs: let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
in {
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./pkgs {inherit pkgs;});
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
devShells =
forAllSystems
(
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default =
devenv.lib.mkShell
{
inherit inputs pkgs;
modules = [
({pkgs, ...}: {
packages = with pkgs; [
hello
inputs.home-manager.packages.${system}.default
inputs.nil.packages.${system}.default
inputs.alejandra.packages.${system}.default
git
neovim
curl
wget
aria2
];
enterShell = ''
hello
'';

processes.run.exec = "hello";
})
];
};
}
);

# Your custom packages and modifications, exported as overlays
overlays = import ./overlays {inherit inputs;};
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./modules/home-manager;

# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
nixos-vm = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
# > Our main nixos configuration file <
./nixos/nixos-vm.nix
];
};
asuna = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
self.nixosModules.cloudflare-warp
#nixosModules.systemd-secure-boot
inputs.lanzaboote.nixosModules.lanzaboote
inputs.impermanence.nixosModules.impermanence
# inputs.hyprland.nixosModules.default
inputs.home-manager.nixosModules.home-manager
./nixos/asuna.nix
{
home-manager = {
useUserPackages = true;
# useGlobalPkgs = true;
extraSpecialArgs = {inherit inputs outputs;};
users.luqman = ./home-manager/luqman-desktop.nix;
};
}
];
};
sinon = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
inputs.home-manager.nixosModules.home-manager
./nixos/sinon.nix

{
home-manager = {
useUserPackages = true;
extraSpecialArgs = {inherit inputs outputs;};
users.luqman = ./home-manager/luqman-sinon.nix;
};
}
];
};
kurumi = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
inputs.home-manager.nixosModules.home-manager
./nixos/kurumi.nix

{
home-manager = {
useUserPackages = true;
extraSpecialArgs = {inherit inputs outputs;};
users.luqman = ./home-manager/luqman-kurumi.nix;
};
}
];
};
};

# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"luqman@nixos-vm" = home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/luqman-desktop.nix
];
};
"luqman@asuna" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
#nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/luqman-desktop.nix
];
};
"luqman@sinon" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [./home-manager/luqman-sinon.nix];
};
};
};
}
File renamed without changes.
19 changes: 19 additions & 0 deletions archives/home-manager/anyrun/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#entry {
background-color: alpha(@theme_fg_color, 0.1);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 16px;
}

#main {
background-color: alpha(@theme_bg_color, 0.3);
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 16px;
}

#plugin {
background-color: transparent;
}

#window {
background: none;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion home-manager/dunst.nix → archives/home-manager/dunst.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
inputs,
config,
pkgs,
lib,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
76 changes: 76 additions & 0 deletions archives/home-manager/luqman-desktop.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
inputs,
outputs,
pkgs,
...
}: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example

# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
./modules
./nvim/lazyvim-nvim.nix
./graphical.nix
./emacs.nix
./mpd.nix
./syncthing.nix
./modules/tools/oci.nix
./neomutt.nix
./modules/editors/astronvim/astronvim.nix
./modules/terminals/zellij.nix
outputs.homeManagerModules.a2ln
inputs.nix-doom-emacs.hmModule
];

# Add stuff for your user as you see fit:
home.packages = with pkgs; [
starship
fish

git
delta
age

# FIXME: seperate cli, desktop profiles
fzf
ripgrep
fd
bat
helix
keychain
tmux
discord
];

dunst.enable = true;
rofi.enable = true;
services.a2ln.enable = true;
mpd.enable = true;
syncthing.enable = true;
neomutt.enable = true;

modules.tools.oci-script.enable = true;

modules.editors.emacs = {
enable = false;
# doom.enable = false;
doom.doomConfigFiles = ./doom-emacs;
};

/*
xdg = {
mime.enable = true;
mimeApps = {
enable = true;
};
};
*/
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";

# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "22.11";
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ in {
fira-code-symbols
jetbrains-mono
(nerdfonts.override {fonts = ["JetBrainsMono" "FiraCode" "Noto"];})
iosevka-solemnattic
self.packages.${pkgs.system}.iosevka-solemnattic

fontconfig
];
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion home-manager/rofi.nix → archives/home-manager/rofi.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
inputs,
pkgs,
lib,
config,
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit aa7236e

Please sign in to comment.