Initial commit

This commit is contained in:
Tasia Iso 2024-04-08 20:32:17 +02:00
commit d3a1b15bca
26 changed files with 979 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
result
NOTES.md

5
common/adguardhome.nix Normal file
View file

@ -0,0 +1,5 @@
{
services.adguardhome.enable = true;
networking.nameservers = ["127.0.0.1"];
}

3
common/de/hyprland.nix Normal file
View file

@ -0,0 +1,3 @@
{
programs.hyprland.enable = true;
}

8
common/de/plasma5.nix Normal file
View file

@ -0,0 +1,8 @@
{
services.xserver = {
enable = true;
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
};
}

17
common/de/plasma6.nix Normal file
View file

@ -0,0 +1,17 @@
{
services.desktopManager.plasma6.enable = true;
services.xserver = {
enable = true;
libinput.enable = true;
displayManager = {
defaultSession = "plasma";
sddm = {
enable = true;
wayland.enable = true;
};
};
};
}

196
common/default.nix Normal file
View file

@ -0,0 +1,196 @@
{
inputs,
outputs,
lib,
config,
pkgs,
...
}: {
imports = [
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
# This will add each flake input as a registry
# To make nix3 commands consistent with your flake
nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nix.nixPath = ["/etc/nix/path"];
environment.etc =
lib.mapAttrs'
(name: value: {
name = "nix/path/${name}";
value.source = value.flake;
})
config.nix.registry;
nix.settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Deduplicate and optimize nix store
auto-optimise-store = true;
};
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
};
# Set your time zone.
time.timeZone = "Europe/Paris";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
users.defaultUserShell = pkgs.zsh;
programs.zsh = {
enable = true;
enableCompletion = true;
autosuggestions.enable = true;
syntaxHighlighting.enable = true;
shellAliases = {
ll = "ls -al";
};
# history.size = 10000;
# history.path = "${config.xdg.dataHome}/zsh/history";
ohMyZsh = {
enable = true;
plugins = [
"git"
# "thefuck"
];
theme = "robbyrussell";
};
};
services.fwupd.enable = true;
programs.neovim = {
enable = true;
defaultEditor = true;
configure = {
customRC = ''
set number
set list
if &diff
colorscheme blue
endif
'';
packages.myVimPackage = with pkgs.vimPlugins; {
start = [
ctrlp
nvim-tree-lua
indent-blankline-nvim
nvim-lspconfig
nvim-treesitter.withAllGrammars
plenary-nvim
gruvbox-material
mini-nvim
];
};
extraLuaConfig =
/*
lua
*/
''
require("nvim-tree").setup()
'';
};
};
networking = {
networkmanager.enable = true;
firewall.enable = true;
};
nix.settings.allowed-users = ["@wheel"];
security = {
#auditd.enable = true;
#audit.enable = true;
#audit.rules = [
# "-a exit,always -F arch=b64 -S execve"
#];
sudo.execWheelOnly = true;
};
services.tailscale.enable = true;
environment.systemPackages = with pkgs; [
wget
dig
nmap
btop
gitFull
smartmontools
lm_sensors
pciutils
gcc
gnumake
sysstat
file
ffmpeg
syncthing
kate
partition-manager
gparted
librewolf
vscodium
vlc
filelight
libreoffice
];
}

View file

@ -0,0 +1,16 @@
{
boot = {
initrd.kernelModules = ["amdgpu"];
# params for Sea Islands or smth
kernelParams = ["radeon.cik_support=0" "amdgpu.cik_support=1"];
};
hardware.opengl = {
enable = true; # Mesa
driSupport = true; # Vulkan
driSupport32Bit = true;
};
services.xserver.videoDrivers = ["amdgpu"];
}

View file

@ -0,0 +1,3 @@
{
hardware.cpu.intel.updateMicrocode = true;
}

17
common/locales/en.nix Normal file
View file

@ -0,0 +1,17 @@
{
time.timeZone = "Europe/Paris";
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
}

View file

@ -0,0 +1,7 @@
{
console.keyMap = "fr";
services.xserver.xkb = {
layout = "fr";
};
}

17
common/locales/fr.nix Normal file
View file

@ -0,0 +1,17 @@
{
time.timeZone = "Europe/Paris";
i18n = {
defaultLocale = "fr_FR.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "fr_FR.UTF-8";
LC_IDENTIFICATION = "fr_FR.UTF-8";
LC_MEASUREMENT = "fr_FR.UTF-8";
LC_MONETARY = "fr_FR.UTF-8";
LC_NAME = "fr_FR.UTF-8";
LC_NUMERIC = "fr_FR.UTF-8";
LC_PAPER = "fr_FR.UTF-8";
LC_TELEPHONE = "fr_FR.UTF-8";
LC_TIME = "fr_FR.UTF-8";
};
};
}

66
flake.lock Normal file
View file

@ -0,0 +1,66 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1712386041,
"narHash": "sha256-dA82pOMQNnCJMAsPG7AXG35VmCSMZsJHTFlTHizpKWQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d6bb9f934f2870e5cbc5b94c79e9db22246141ff",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1712439257,
"narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1712439257,
"narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}
}
},
"root": "root",
"version": 7
}

95
flake.nix Normal file
View file

@ -0,0 +1,95 @@
{
description = "Your new nix config";
inputs = {
# Nixpkgs
# nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's an working example:
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# Also see the 'unstable-packages' overlay at 'overlays/default.nix'.
# Home manager
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
# TODO: Add any other flake you might need
# 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";
};
outputs = {
self,
nixpkgs,
home-manager,
...
} @ inputs: let
inherit (self) outputs;
# Supported systems for your flake packages, shell, etc.
systems = [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
];
# This is a function that generates an attribute by calling a function you
# pass to it, with each system as an argument
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
# Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
# Formatter for your nix files, available through 'nix fmt'
# Other options beside 'alejandra' include 'nixpkgs-fmt'
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
# 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 build --flake .#phoenix'
nixosConfigurations = {
phoenix = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/phoenix/configuration.nix
];
};
stuff = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./hosts/stuff/configuration.nix
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#user@phoenix'
# homeConfigurations = {
# "user@phoenix" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs;};
# modules = [
# ./hosts/phoenix/home.nix
# ];
# };
# "user@stuff" = home-manager.lib.homeManagerConfiguration {
# pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
# extraSpecialArgs = {inherit inputs outputs;};
# modules = [
# ./hosts/stuff/home.nix
# ];
# };
# };
};
}

View file

@ -0,0 +1,133 @@
{pkgs, ...}: {
imports = [
./hardware-configuration.nix
../../common/default.nix
../../common/locales/en.nix
../../common/locales/fr-keymap.nix
../../common/hardware/intelcpu.nix
../../common/hardware/amdgpu.nix
../../common/de/plasma6.nix
../../common/de/hyprland.nix
./syncthing.nix
../../common/adguardhome.nix
# If you want to use modules your own flake exports (from modules/nixos):
# outputs.nixosModules.example
# Or modules from other flakes (such as nixos-hardware):
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
];
boot = {
kernelPackages = pkgs.linuxPackages_latest;
# boot.kernelModules = [ "fuse" "kvm-intel" "coretemp" ];
};
networking = {
hostName = "phoenix";
firewall.enable = true;
firewall.allowedTCPPorts = [8080 12345 13378];
firewall.allowedUDPPorts = [8080];
};
users.users.user = {
isNormalUser = true;
description = "User";
extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"];
initialPassword = "correcthorsebatterystaple";
openssh.authorizedKeys.keys = [
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
];
};
services.btrfs.autoScrub = {
enable = true;
interval = "weekly";
fileSystems = ["/" "/data"];
};
virtualisation.docker.enable = true;
services.flatpak.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
programs.mtr.enable = true;
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
programs.steam = {
enable = true;
remotePlay.openFirewall = false; # Open ports in the firewall for Steam Remote Play
dedicatedServer.openFirewall = false; # Open ports in the firewall for Source Dedicated Server
};
environment.systemPackages = with pkgs; [
bitwarden
libreoffice-fresh
nextdns
android-tools
gocryptfs
#endless-sky
#gnucash
obs-studio
kdenlive
rustc
cargo
nodejs
rpi-imager
wireshark
appimage-run
#ssb-patchwork
simplex-chat-desktop
#android-studio
#swig
picard
kleopatra
qbittorrent
tor-browser
protonvpn-gui
# radicle-cli
# opensnitch-ui
yarn
nodePackages.node-gyp
nodePackages.node-pre-gyp
superTuxKart
openssl
# qgis
helix
holehe
smartmontools
cheat
lazygit
ripgrep
jq
yq
neofetch
tldr
bat
dust
powertop
fzf
atuin
zellij
eza
lapce
gotty
gping
yazi
tildefriends
];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.05";
}

View file

@ -0,0 +1,58 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/469da268-3ac1-4591-9209-26c89afb2e59";
fsType = "btrfs";
options = ["subvol=@"];
};
boot.initrd.luks.devices."luks-06613ddd-abd6-409e-9a33-889cb9d15d11".device = "/dev/disk/by-uuid/06613ddd-abd6-409e-9a33-889cb9d15d11";
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/E398-A9BF";
fsType = "vfat";
};
fileSystems."/data" = {
device = "/dev/disk/by-uuid/648ae2f4-bd2e-4315-b12f-72733f92d2e0";
fsType = "btrfs";
};
boot.initrd.luks.devices."539c1a57-e6d0-4ff0-927a-8f0d4aa4c9c7".device = "/dev/disk/by-uuid/539c1a57-e6d0-4ff0-927a-8f0d4aa4c9c7";
fileSystems."/home" = {
device = "/dev/disk/by-uuid/469da268-3ac1-4591-9209-26c89afb2e59";
fsType = "btrfs";
options = ["subvol=@home"];
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

68
hosts/phoenix/home.nix Normal file
View file

@ -0,0 +1,68 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
outputs,
lib,
config,
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
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = _: true;
};
};
home = {
username = "user";
homeDirectory = "/home/user";
};
# Add stuff for your user as you see fit:
# programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
# Enable home-manager and git
programs.home-manager.enable = true;
programs.git.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 = "23.05";
}

View file

@ -0,0 +1,13 @@
{
services.syncthing = {
enable = true;
user = "user";
group = "users";
dataDir = "/home/user";
configDir = "/data/sync/configuration/";
openDefaultPorts = true;
overrideFolders = false;
overrideDevices = false;
};
}

View file

@ -0,0 +1,40 @@
{pkgs, ...}: {
imports = [
./hardware-configuration.nix
../../common/default.nix
../../common/locales/fr.nix
../../common/locales/fr-keymap.nix
../../common/hardware/intelcpu.nix
../../common/de/plasma5.nix
./syncthing.nix
# ../../common/adguardhome.nix
];
users.users.user = {
isNormalUser = true;
description = "User";
extraGroups = ["networkmanager" "wheel" "dialout" "syncthing"];
initialPassword = "correcthorsebatterystaple";
openssh.authorizedKeys.keys = [
# TODO: Add your SSH public key(s) here, if you plan on using SSH to connect
];
};
networking = {
hostName = "stuff";
firewall.enable = true;
#firewall.allowedTCPPorts = [ ];
#firewall.allowedUDPPorts = [ ];
};
environment.systemPackages = with pkgs; [
# Additional system packages here
];
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,43 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "rtsx_pci_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
fileSystems."/" = {
device = "/dev/disk/by-uuid/699da114-1ef6-4887-9083-a03eb9e51049";
fsType = "btrfs";
options = ["subvol=@"];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/C0F6-5EAB";
fsType = "vfat";
};
swapDevices = [];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0f2.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

68
hosts/stuff/home.nix Normal file
View file

@ -0,0 +1,68 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{
inputs,
outputs,
lib,
config,
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
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = _: true;
};
};
home = {
username = "user";
homeDirectory = "/home/user";
};
# Add stuff for your user as you see fit:
# programs.neovim.enable = true;
# home.packages = with pkgs; [ steam ];
# Enable home-manager and git
programs.home-manager.enable = true;
programs.git.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 = "23.11";
}

12
hosts/stuff/syncthing.nix Normal file
View file

@ -0,0 +1,12 @@
{
services.syncthing = {
enable = true;
user = "user";
group = "users";
dataDir = "/home/user";
openDefaultPorts = true;
overrideFolders = false;
overrideDevices = false;
};
}

View file

@ -0,0 +1,6 @@
# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
}

View file

@ -0,0 +1,6 @@
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
# These should be stuff you would like to share with others, not your personal configurations.
{
# List your module files here
# my-module = import ./my-module.nix;
}

23
overlays/default.nix Normal file
View file

@ -0,0 +1,23 @@
# This file defines overlays
{inputs, ...}: {
# This one brings our custom packages from the 'pkgs' directory
additions = final: _prev: import ../pkgs {pkgs = final;};
# This one contains whatever you want to overlay
# You can change versions, add patches, set compilation flags, anything really.
# https://nixos.wiki/wiki/Overlays
modifications = final: prev: {
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });
};
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
# be accessible through 'pkgs.unstable'
unstable-packages = final: _prev: {
unstable = import inputs.nixpkgs-unstable {
system = final.system;
config.allowUnfree = true;
};
};
}

6
pkgs/default.nix Normal file
View file

@ -0,0 +1,6 @@
# Custom packages, that can be defined similarly to ones from nixpkgs
# You can build them using 'nix build .#example'
{ pkgs, ... }:
{
tildefriends = pkgs.callPackage ./tildefriends/default.nix { };
}

View file

@ -0,0 +1,51 @@
{ lib
, stdenv
, fetchFromGitea
, gnumake
, openssl
, which
}:
stdenv.mkDerivation rec {
pname = "tildefriends";
version = "0.0.17";
src = fetchFromGitea {
domain = "dev.tildefriends.net";
owner = "cory";
repo = "tildefriends";
rev = "v${version}";
hash = "sha256-Wc9MvafA2rPmjnRvmMB3qmRyDQNhF688weKItHw3E8I=";
};
nativeBuildInputs = [
gnumake
openssl
which
];
buildPhase = ''
make -j $NIX_BUILD_CORES release
'';
installPhase = ''
mkdir -p $out/bin
cp -r out/release/* $out/bin
'';
doCheck = false;
meta = {
homepage = "https://tildefriends.net/";
description = "Make apps and friends from the comfort of your web browser.";
longDescription = ''
TODO
'';
mainProgram = "tildefriends";
license = with lib.licenses; [ mit ];
maintainers = with lib.maintainers; [ tasiaiso ];
platforms = lib.platforms.all;
};
}